通常,如果我有一个很长的公式,我会在 align 环境中使用两行,并使用 \qquad 来很好地分隔开。例如,
\begin{align*}
% First line
\rho\left(\frac{\partial u_{r}}{\partial t}+u_{r}\frac{\partial u_{r}}{\partialr}+\frac{u_{\phi}}{r}\frac{\partial u_{r}}{\partial\phi}+u_{z}\frac{\partial u_{r}}{\partial z}-\frac{u_{\phi}^{2}}{r}\right) & =-\frac{\partial p}{\partial r}+\mu\Biggl[\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u_{r}}{\partial r}\right)+\frac{1}{r^{2}}\frac{\partial^{2}u_{r}}{\partial\phi^{2}}
\\
% Second line
& \qquad\qquad\qquad\qquad
+\frac{\partial^{2}u_{r}}{\partial z^{2}}-\frac{u_{r}}{r^{2}}-\frac{2}{r^{2}}\frac{\partial u_{\phi}}{\partial\phi}\Biggr]+\rho g_{r}
\end{align*}
生产
但是,这种对齐方法很繁琐,如果不偏移第二条线,通常会导致效果不佳。是否有一个环境可以自动实现此操作?
答案1
我认为在以下情况下使用multline*
而不是align*
是正确的方法:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
\rho\left(\frac{\partial u_{r}}{\partial t}+u_{r}\frac{\partial u_{r}}{\partial r}+
\frac{u_{\phi}}{r}\frac{\partial u_{r}}{\partial\phi}+u_{z}\frac{\partial u_{r}}{\partial z}-
\frac{u_{\phi}^{2}}{r}\right)=\\
-\frac{\partial p}{\partial r}+
\mu\Biggl[\frac{1}{r}\frac{\partial}{\partial r}\left(r\frac{\partial u_{r}}{\partial r} \right)+
\frac{1}{r^{2}}\frac{\partial^{2}u_{r}}{\partial\phi^{2}}+
\frac{\partial^{2}u_{r}}{\partial z^{2}}-\frac{u_{r}}{r^{2}}-
\frac{2}{r^{2}}\frac{\partial u_{\phi}}{\partial\phi}\Biggr]+\rho g_{r}
\end{multline*}
\end{document}