您如何对齐方程式系统?

use*_*234 4 latex mathjax

我希望这些方程式对齐,以便所有变量和运算符都直接向下移动。我尝试了几种不同的技术,但未能使其正常工作。

在此处输入图片说明

不:

\begin{align*}
  x+y+z=1 \\ 
  x+y+z=\frac{5}{2} \\ 
  x+y+z=5
\end{align*}
Run Code Online (Sandbox Code Playgroud)

摆弄

Pat*_*ner 10

使用&=以表示与等号一致:

\begin{align*}
  x+y+z &= \,1 \\ 
  x+y+z &= \frac{5}{2} \\ 
  x+y+z &= \,5
\end{align*}
Run Code Online (Sandbox Code Playgroud)

对齐并间隔一点

您可以在数学模式下使用这些:

\; - a thick space
\: - a medium space
\, - a thin space     <-- used this here in front of the simple numbers
\! - a negative thin space
Run Code Online (Sandbox Code Playgroud)

资料来源:http : //www.emerson.emory.edu/services/latex/latex_119.html

您可以align*在此处重新阅读环境 fe:https : //en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics#align_and_align *


And*_*ann 8

有一个systeme用于线性方程组的程序包,该程序可以自动对齐变量和值-它甚至可以为您检测变量。

在标准设置中,您只需编写

\begin{equation*}
  \systeme{
  x+y+z = 1,
  x+y+z = \frac{5}{2},
  x+y+z = 5
  }
\end{equation*}
Run Code Online (Sandbox Code Playgroud)

样品输出

要么

\begin{equation*}
  \systeme{
  3x +7z = 20,
  y - 17z = -3,
  24x + 15y = 7
  }
\end{equation*}
Run Code Online (Sandbox Code Playgroud)

第二个一般例子

可能适合或不适合您的口味。可以通过在\systeme命令前面加上空定界符来删除方括号

\sysdelim..
Run Code Online (Sandbox Code Playgroud)

.是一个空的占位符,\sysdelim需要两个,因为它指定了左定界符和右定界符)。要使分数更大,可以\dfracamsmath已装入的包中使用它,但随后必须帮助行距:

第二样本

\documentclass{article}

\usepackage{amsmath,systeme}

\begin{document}

\begin{equation*}
  \systeme{
  x+y+z = 1,
  x+y+z = \frac{5}{2},
  x+y+z = 5
  }
\end{equation*}

No delimeter, displaystyle fraction and line spacing
\begin{equation*}
  \sysdelim..\systeme{
  x+y+z = 1,
  x+y+z = \dfrac{5}{2}\rule[-3ex]{0pt}{7ex},
  x+y+z = 5
  }
\end{equation*}

\end{document}
Run Code Online (Sandbox Code Playgroud)

或者,可以通过以下命令在所有行之间添加额外的间距\syslineskipcoeff,这是比例因子:

第三样本

\documentclass{article}

\usepackage{amsmath,systeme}

\begin{document}

No delimeter, displaystyle fraction and line spacing
\begin{equation*}
  \sysdelim..\syslineskipcoeff{2}\systeme{
  x+y+z = 1,
  x+y+z = \dfrac{5}{2},
  x+y+z = 5
  }
\end{equation*}

\end{document}
Run Code Online (Sandbox Code Playgroud)