(十一)Latex多行公式排版

ps:
<1> \text{中文}:在数学模式中实现中文排版

\documentclass{
     ctexart}

\usepackage{
     amsmath}
\usepackage{
     amssymb}

\begin{
     document}
 %gather(带编号),gather*(不带编号)
 \begin{
     gather}
  a + b = b + a \\
  ab ba
 \end{
     gather}
 
 \begin{
     gather*}
  3 + 5 = 5 + 3 =8 \\
  3 \times 5 = 5 \time 3
 \end{
     gather*}
 
 \begin{
     gather}
  3^2 + 4^2 = 5^2 \notag \\ %阻止编号
  5^2 + 12^2 = 13^2 \notag \\
  a^2 + b^2 = c^2
 \end{
     gather}
 
 % align和align*环境(&进行对齐)
 % 等号对齐 不带编号
 \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*}
 
 % split环境(对齐采用align环境得方式,编号在中间)
 \begin{
     equation}
  \begin{
     split}
   \cos 2x &= \cos^2 x - \sin^2 x \\
   &= 2\cos^2 x -1
  \end{
     split}
 \end{
     equation}
 
 % case环境
 % 每行公式中使用&分隔为两部分
 % 通常表示值和后面的条件
 \begin{
     equation}
  D(x) = \begin{
     cases}
  1, & \text{
     如果 } x \in \mathbb{
     Q}; \\
  0, & \text{
     如果 } x \in \mathbb{
     R};
  \end{
     cases}
 \end{
     equation}
\end{
     document}

(十一)Latex多行公式排版_第1张图片

你可能感兴趣的:(#,LaTeX学习笔记)