GitHub:https://github.com/qinnian/LaTeX
微信公众号【钦念博客】:[LaTeX 教程资源汇总(推荐)]
一、公式排版
-
行内公式:数学公式与文字混排
-
行间公式:数学公式单独列为一行
\documentclass[UTF8]{ctexart}
\begin{document}
% 行内公式由一对 $ 符号包裹
The Pythagorean theorem is $a^2 + b^2 = c^2$.
%行间公式由 equation 环境包裹
The Pythagorean theorem is:
\begin{equation}
a^2 + b^2 = c^2
\end{equation}
\end{document}
二、数学符号
希腊字母符号的名称就是其英文名称,如 α (\alpha)、β (\beta) 等等
\documentclass[UTF8]{ctexart}
\begin{document}
$a_1, a_2, \dots, a_n$ \\
$a_1 + a_2 + \cdots + a_n$
\end{document}
用 ^ 和 _ 标明上下标,上下标的内容一般需要用花括号包裹,否则上下标只对后面的一个符号起作用。
\documentclass[UTF8]{ctexart}
\begin{document}
$p^3_{ij} \qquad
m_\mathrm{Knuth}\qquad
\sum_{k=1}^3 k $\\[5pt]
$a^x+y \neq a^{x+y}\qquad
e^{x^2} \neq {e^x}^2$
\end{document}
导数符号'(′) 是一类特殊的上标,可以适当连用表示多阶导数,也可以在其后连用上标
\documentclass[UTF8]{ctexart}
\begin{document}
$f(x) = x^2 \quad f'(x)
= 2x \quad f''^{2}(x) = 4$
\end{document}
分式使用 \frac{分子}{分母} 来书写。分式的大小在行间公式中是正常大小,而在行内被极度压缩。
\documentclass[UTF8]{ctexart}
\begin{document}
\[\frac{3}{8}\]
\end{document}
三、普通符号
推荐阅读