LaTeX 语法

MathJax是什么?

MathJax是一个开源JavaScript库。它支持LaTeX、MathML、AsciiMath符号,可以运行于所有流行浏览器上。

LaTeX是什么?

LaTeX(LATEX,音译“拉泰赫”)是一种基于ΤΕΧ的排版系统。

如何使用LaTeX公式?

  1. To see how any formula was written, right-click on the expression it and choose "Show Math As > TeX Commands"(When you do this, the '$' will not display.)

  2. For inline formulas $...$. For displayed formulas $$...$$.

  3. For superscripts and subscripts, use ^ and _.

  4. Groups. {…} . 10^10 \(10^10\)10^{10} \(10^{10}\).

  5. 正或负:\pm \(\pm\) \mp \(\mp\)

  6. 比较:\leq \(\leq\) \geq \(\geq\) \neq \(\neq\) \approx \(\approx\) \ngeq \(\ngeq\)

  7. Fractions. \frac{a+1}{b+1} \(\frac{a+1}{b+1}\)

  8. 带字符的箭头:\leftarrow \(\leftarrow\) \rightarrow \(\rightarrow\) \leftrightarrow \(\leftrightarrow\) \stackrel{r_1+r_2}{\longrightarrow} \(\stackrel{r_1+r_2}{\longrightarrow}\)

  9. Radical signs. \sqrt{x^3} \(\sqrt{x^3}\)

  10. Accents and diacritical marks. \hat{x} \(\hat{x}\) \bar{x} \(\bar{x}\) \vec{x} \(\vec{x}\) \dot{x} \(\dot{x}\) \ddot{x} \(\ddot{x}\)

  11. Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n \(\sum_1^n\).

  12. 显示MathJax预定义的字符:\$ \(\$\)\backslash \(\backslash\)\\ 换行。

  13. For Greek letters

语法 (大写) 显示 (大写) 语法 (大写) 显示 (大写)
\alpha \(\alpha\) \nu \(\nu\)
\beta \(\beta\) \xi \(\xi\) (\(\Xi\))
\gamma (\Gamma) \(\gamma\) (\(\Gamma\)) \omicron \(\omicron\)
\delta (\Delta) \(\delta\) (\(\Delta\)) \pi \(\pi\) (\(\Pi\))
\epsilon \(\epsilon\) \rho \(\rho\)
\zeta \(\zeta\) \sigma \(\sigma\) (\(\Sigma\))
\eta \(\eta\) \tau \(\tau\)
\theta (\Theta) \(\theta\) (\(\Theta\)) \upsilon \(\upsilon\)
\iota \(\iota\) \phi \(\phi\) (\(\Phi\))
\kappa \(\kappa\) \chi \(\chi\)
\lambda (\Lambda) \(\lambda\) (\(\Lambda\)) \psi \(\psi\) (\(\Psi\))
\mu \(\mu\) \omega \(\omega\) (\(\Omega\))

Matrices

矩阵语法:\begin{matrix}…\end{matrix} 同一行的元素之间使用 & 分割,每行以 \\ 结尾。如:

$$
    \begin{matrix}
    1 & x & x^2 \\
    1 & y & y^2 \\
    1 & z & z^2 \\
    \end{matrix}
$$

EX01. matrix 关键字可以替换成一下其他关键字。

关键字 显示
matrix \(\begin{matrix}1&2\\3&4\end{matrix}\)
pmatrix \(\begin{pmatrix}1&2\\3&4\end{pmatrix}\)
bmatrix \(\begin{bmatrix}1&2\\3&4\end{bmatrix}\)
Bmatrix \(\begin{Bmatrix}1&2\\3&4\end{Bmatrix}\)
vmatrix \(\begin{vmatrix}1&2\\3&4\end{vmatrix}\)
Vmatrix \(\begin{Vmatrix}1&2\\3&4\end{Vmatrix}\)

EX02. 不同方向的省略号。 \cdots -> \(\cdots\) \ddots -> \(\ddots\) \vdots -> \(\vdots\)

\[\begin{pmatrix} 1 & a_1 & a_1^2 & \cdots & a_1^n \\ 1 & a_2 & a_2^2 & \cdots & a_2^n \\ \vdots & \vdots& \vdots & \ddots & \vdots \\ 1 & a_m & a_m^2 & \cdots & a_m^n \end{pmatrix} \]

EX03. 行中的小矩阵。 \bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr) -> \(\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr)\)

posted @ 2018-12-18 14:10  郑大峰  阅读(224)  评论(0编辑  收藏  举报