使LATEX之所以能够成为编辑科学文档的正确工具,是它能够渲染复杂的数学表达式。 本文介绍了显示方程式的基本命令。
介绍
基本方程式在LATEX中可以很容易地“编程”,例如:
\begin{CJK*}{UTF8}{gbsn}
%--------------------------------------------------------------------------------
\section{First example}
众所周知的毕达哥拉斯定理 \(x^2 + y^2 = z^2\) 为被证明对其他指数无效. 意味着下一个方程式(\(n > 3\))没有整数解:
\[ x^n + y^n = z^n \]
\end{CJK*}
如您所见,方程式的显示方式取决于定界符(delimiter),在这种情况下为 \\[ \\]和\\( \\)。
数学模式
LATEX允许两种用于数学表达式的书写模式:内联模式和显示模式。 第一个用于编写作为文本一部分的公式。 第二个表达式用于编写不属于文本或段落的表达式,因此放在单独的行上。
让我们看一个内联模式的例子:
In physics, the mass-energy equivalence is stated
by the equation $E=mc^2$, discovered in 1905 by Albert Einstein.
要将方程式置于内联模式,请使用以下定界符之一: \\( \\),$ $或 \\begin{math} \\end{math}。 它们都起作用,选择取决于个人喜好。
The mass-energy equivalence is described by the famous equation
\[E=mc^2\]
discovered in 1905 by Albert Einstein.
In natural units ($c$ = 1), the formula expresses the identity
\begin{equation}
E=m
\end{equation}
要在显示模式下显示方程式,请使用以下定界符之一:\\[\\],\begin {displaymath} \end {displaymath}或\begin {equation} \end {equation}
重要提示:equation *环境由外部软件包提供,请参阅amsmath文章。
参考指南
下表是一些常用数学符号的表格。 有关更完整的列表,请参阅希腊字母和数学符号列表:
description | code | examples |
Greek letters | \alpha \beta \gamma \rho \sigma \delta \epsilon | |
Binary operators | \times \otimes \oplus \cup \cap | |
Relation operators | < > \subset \supset \subseteq \supseteq | |
Others | \int \oint \sum \prod |
不同类别的数学符号具有不同的格式(例如,变量用斜体表示,而运算符则没有)和不同的间距。
完整代码和生成的文档预览:
\documentclass{article}
\usepackage{CJKutf8}
\usepackage{amsmath}
\begin{document}
\begin{CJK*}{UTF8}{gbsn}
%--------------------------------------------------------------------------------
\section{First example}
众所周知的毕达哥拉斯定理 \(x^2 + y^2 = z^2\) 为被证明对其他指数无效. 意味着下一个方程式(\(n > 3\))没有整数解:
\[ x^n + y^n = z^n \]
\end{CJK*}
%--------------------------------------------------------------------------------
\section{Second example}
In physics, the mass-energy equivalence is stated by the equation $E=mc^2$, discovered in 1905 by Albert Einstein.
The mass-energy equivalence is described by the famous equation
\[ E=mc^2 \]
discovered in 1905 by Albert Einstein.
In natural units ($c$ = 1), the formula expresses the identity
\begin{equation}
E=m
\end{equation}
\section{Third example}
This is a simple math expression \(\sqrt{x^2+1}\) inside text.
And this is also the same:
\begin{math}
\sqrt{x^2+1}
\end{math}
but by using another command.
This is a simple math expression without numbering
\[\sqrt{x^2+1}\]
separated from text.
This is also the same:
\begin{displaymath}
\sqrt{x^2+1}
\end{displaymath}
\ldots and this:
\begin{equation*}
\sqrt{x^2+1}
\end{equation*}
\[\alpha \beta \gamma \rho \sigma \delta \epsilon\]
\[\times \otimes \oplus \cup \cap\]
\[< > \subset \supset \subseteq \supseteq\]
\[\int \oint \sum \prod\]
\end{document}
翻译如下文章
原文:https://www.overleaf.com/learn/latex/Mathematical_expressions