[LATEX] 數學表達式

使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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章