1 代码部分
\documentclass{article}
\usepackage{ctex}
\usepackage{amsmath}
\usepackage{amssymb}
\title{数学模式中的多行数学公式}
\author{张三丰}
\date{\today}
\begin{document}
\maketitle
\begin{gather}
a + b = b + a \\
ab ba
\end{gather}
\begin{gather*}
a + b = b + a \\
ab ba
\end{gather*}
\begin{gather}
3^2 + 4^2 = 5^2 \notag \\
5^2 + 12^2 = 13^2 \notag \\
a^2 + b^2 =c^2\notag
\end{gather}
\begin{align}
x &= t+ \cos t + 1 \\
y &= 2\sin t
\end{align}
\begin{align*}
x &= t & x &= \cos t & x & =t \\
y &= 2t & y & = \sin (t+1) & y &= \sin t
\end{align*}
\begin{equation}
\begin{split}
\cos 2x &= \cos^2 x - \sin^2 x \\
&= 2\cos^2 x - 1
\end{split}
\end{equation}
\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}
2 效果演示部分