答案1
有(至少)两种方法可以解决您的格式问题:
仅对
=
符号进行对齐沿左边缘和
=
符号对齐。
以下示例介绍了这两种方法。第一种方法使用aligned
环境,第二种方法使用alignedat[2]
环境。这两种环境在用户指南中都有详细说明数学包裹。
\documentclass{article}
\usepackage{amsmath} % for 'gather', 'aligned', and 'alignedat' environments
%% macro for displaying variable names (vn):
\newcommand\vn[1]{\mathtt{#1}} % or '\mathrm', '\mathit'
\begin{document}
\begin{gather}
\begin{aligned}
\vn{AdditionandMultiplication}(a, b_i) &= \sin(p\omega\omega_{4_i}) \\
\vn{AdditionandMultiplication}(a, {b}_i + 1) &= \tanh(p\omega\omega_{25_i})
\end{aligned} \\[1\baselineskip]
\begin{alignedat}{2}
&\vn{AdditionandMultiplication}(a, b_i) &&= \sin(p\omega\omega_{4_i}) \\
&\vn{AdditionandMultiplication}(a, {b}_i + 1) &&= \tanh(p\omega\omega_{25_i})
\end{alignedat}
\end{gather}
\end{document}
答案2
\documentclass[preview,border=12pt,12pt]{standalone} %change it to your own documentclass
\usepackage{mathtools} % you need this package
\begin{document}
\minipage{5cm} % you don't need this line
% code between BEGIN and END are what you need!
% BEGIN
\begin{equation}
\begin{aligned}
E &\not= mc^2\\
pV &\not= n R T
\end{aligned}
\end{equation}
% END
\endminipage % you don't need this line
\end{document}