[TOC]html
本系列是有關LaTeX的學習系列,共計19篇,本章節是第16篇。 前一篇:15LaTeX學習系列之---LaTeX裏插入數學公式 後一篇:17LaTeX學習系列之---LaTeX的版面設計 總目錄:19LaTeX學習系列之---LaTeX的總結函數
前一節咱們學習了怎麼在LaTeX中插入數學公式,本小節,咱們補充在LaTeX中長公式的使用。學習
- ** 號問題:在環境中有星號則無編號,無星號有編號。
- \ \ :換行
- \ref{fig:01}引用標籤,\label{fig:01}添加標籤,實現交叉引用
- \text{文字}:在數學模式中輸入文字
用途:能夠寫多行公式,對齊方式是總體中間對齊spa
%多行公式--帶編號 \begin{gather} a + b +c = b + a \\ 1+2 = 2 + 1 \end{gather}
$$ %多行公式--帶編號 \begin{gather} a + b +c = b + a \ 1+2 = 2 + 1 \end{gather} $$設計
(下面的是否帶編號相似)code
%多行公式--不帶編號1 \begin{gather*} a + b = b + a \\ 1+2 = 2 + 1 \end{gather*}
$$ %多行公式--不帶編號1 \begin{gather*} a + b = b + a \ 1+2 = 2 + 1 \end{gather*} $$htm
%多行公式--帶編號2 \notag 阻止編號 \begin{gather} a + b = b + a \notag \\ 1+2 = 2 + 1 \notag \end{gather}
$$ %多行公式--帶編號2 \notag 阻止編號 \begin{gather} a + b = b + a \notag \ 1+2 = 2 + 1 \notag \end{gather} $$blog
按&號對齊,本身指定對齊方式get
% 按&號對齊,--帶編號 \begin{align} a+b &= b+a \\ 1+2= & 2+1 \end{align}
$$ % 按&號對齊,--帶編號 \begin{align} a+b &= b+a \ 1+2= & 2+1 \end{align} $$數學
當一個公式須要多行排版時,對齊方式也是按&對齊
%一個公式的多行排版--帶編號 \begin{equation} \begin{split} \cos 2x &= \cos^2 x - \sin^2x \\ &=2\cos^2x-1 \end{split} \end{equation}
$$ %一個公式的多行排版--帶編號 \begin{equation} \begin{split} \cos 2x &= \cos^2 x - \sin^2x \ &=2\cos^2x-1 \end{split} \end{equation} $$
分段函數或者有左大括號的數學公式
%case環境, text{}在數學模式中處理中文-帶編號 \begin{equation} D(x)=\begin{cases} 1, & \text{若是} x \in \mathbb{Q};\\ 0, & \text{若是} x \in \mathbb{R}\setminus\mathbb{Q} \end{cases} \end{equation}
$$ %case環境, text{}在數學模式中處理中文-帶編號 \begin{equation} D(x)=\begin{cases} 1, & \text{若是} x \in \mathbb{Q};\ 0, & \text{若是} x \in \mathbb{R}\setminus\mathbb{Q} \end{cases} \end{equation} $$
%導言區 \documentclass{ctexart} %導入宏包 \usepackage{amsmath} \usepackage{amssymb} %正文區 \begin{document} %多行公式--帶編號 \begin{gather} a + b +c = b + a \\ 1+2 = 2 + 1 \end{gather} %多行公式--不帶編號1 \begin{gather*} a + b = b + a \\ 1+2 = 2 + 1 \end{gather*} %多行公式--帶編號2 \notag 阻止編號 \begin{gather} a + b = b + a \notag \\ 1+2 = 2 + 1 \notag \end{gather} % 按&號對齊,--帶編號 \begin{align} a+b &= b+a \\ 1+2= & 2+1 \end{align} % 按&號對齊,--不帶編號 \begin{align*} a+b &= b+a \\ 1+2 &=2+1 \end{align*} %一個公式的多行排版--帶編號 \begin{equation} \begin{split} \cos 2x &= \cos^2 x - \sin^2x \\ &=2\cos^2x-1 \end{split} \end{equation} %一個公式的多行排版--不帶編號 \begin{equation*} \begin{split} \cos 2x &= \cos^2 x - \sin^2x \\ &=2\cos^2x-1 \end{split} \end{equation*} %case環境, text{}在數學模式中處理中文-帶編號 \begin{equation} D(x)=\begin{cases} 1, & \text{若是} x \in \mathbb{Q};\\ 0, & \text{若是} x \in \mathbb{R}\setminus\mathbb{Q} \end{cases} \end{equation} %case環境, text{}在數學模式中處理中文-不帶編號 \begin{equation*} D(x)=\begin{cases} 1, & \text{若是} x \in \mathbb{Q};\\ 0, & \text{若是} x \in \mathbb{R}\setminus\mathbb{Q} \end{cases} \end{equation*} \end{document}
本系列是有關LaTeX的學習系列,共計19篇,本章節是第16篇。 前一篇:15LaTeX學習系列之---LaTeX裏插入數學公式 後一篇:17LaTeX學習系列之---LaTeX的版面設計 總目錄:19LaTeX學習系列之---LaTeX的總結