Maths — your first formula
此页面需较新浏览器(支持 SharedArrayBuffer)。请升级 Chrome、Edge、Firefox 或 Safari 至最新版本。
数学模式
- 这正是 LaTeX 出名的本领。要写数学,就用美元符号切换进数学模式:
The equation $E = mc^2$ changed physics.
$ ... $之间的内容会被排成数学公式,直接嵌在句子里。这就是行内数学。
幂与下标
^表示上标(幂);_表示下标:
$x^2$, $a_1$, and $x^2 + y^2 = r^2$
- 如果上下标多于一个字符,用花括号把它们括起来:
$x^{10}$、$a_{i+1}$。
单独居中的大公式
- 想让一个重要公式单独占一行,就用**行间(display)**数学
\[ ... \]:
\[ a^2 + b^2 = c^2 \]
- 现在,在下面的任务里写出你自己的行内公式吧。
常见错误
x^10用于 x 的 10 次方。 只有首个字符会被上标化,因此得到 x¹0。请使用花括号分组:x^{10}。_或^出现在数学符号外。file_name在纯文本中会产生! Missing $ inserted.。请写file\_name,或将实际数学内容放在$...$内。\[ ... \]内部的空行。 显示模式下的数学公式不允许包含段落分隔符,因此这同样会导致! Missing $ inserted.错误。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Replace the words with real maths. Write the area of a circle as an inline formula: $A = \pi r^2$. The $ ... $ turns on maths mode, \pi is π, and ^2 is the power.
点击“运行”编译并预览 PDF。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
For an important equation, give it its own line with display maths \[ ... \]. Write Pythagoras' theorem: \[ a^2 + b^2 = c^2 \].
点击“运行”编译并预览 PDF。
难度 2/5 · 今日首次完成可获 140 金币及少量额外奖励
Write the change in position as an inline formula: $\Delta x = x_2 - x_1$. \Delta is the capital Greek delta, and _ makes a subscript.
点击“运行”编译并预览 PDF。