我想将这个长方程分成三或四份(以适合 A4 纸),并保持等号对齐。我试过\split
和\multline
代码,但仍然不行。可能是因为\left[
和\right]
包围了整个方程?
$$
R_i=\Delta_x\Delta_y\left[ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
- \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \right]
$$
答案1
记住$$
在 LaTeX 中永远不要使用,请参阅为什么 \[ ... \] 比 $$ ... $$ 更可取?,这里有两种变体split
,可以实现更平衡的输出:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
R_i=\Delta_x\Delta_y
\biggl[
& \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
\\
&+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\\
&- \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
- \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
\\
&- \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\biggr]
\end{split}
\end{equation}
\begin{equation}
\begin{split}
R_i=\Delta_x\Delta_y
\biggl[
& \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
\\
{}+{}& \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\\
{}-{}& \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
- \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
\\
{}-{}& \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\biggr]
\end{split}
\end{equation}
\end{document}
答案2
一个典型的解决方案。您将选择拆分的位置。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
%$$
\begin{align*}
R_i&=
\Delta_x\Delta_y
%\left[
\biggl[
\Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
+\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}} \\
&\qquad
+\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
-\Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}} \\
&\qquad - \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\
&\qquad
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}
\biggr]
%\right]
\end{align*}
%$$
\end{document}
答案3
事实上,不允许在单独的行上有不匹配的\left
和语句。\right
这是一个解决方案,(a)使用\biggl[
和\biggr]
创建大型“围栏”,(b)使用split
嵌套在环境内的环境(三个换行符)equation
。根据@egreg的建议,选择换行符是为了利用表达式中存在的一点对称性。(如果您不喜欢\biggl[
和第一个\Delta_1\Delta_2
术语之间的差距,只需省略该术语\phantom{{}+{}}
。)
\documentclass{article}
\usepackage{amsmath} % for "split" environment
\begin{document}
\begin{equation}\begin{split}
R_i=\Delta_x\Delta_y\biggl[
&\phantom{{}+{}}\Delta_{1}\Delta_{2}\frac{\partial{\Delta_{21}}}{\partial{w_i}}
+ \Delta_{1}\Delta_{2}\frac{\partial{\Delta_{22}}}{\partial{w_i}} \\
&+ \Delta_{2}\Delta_{1}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
+\Delta_{2}\Delta_{1}\frac{\partial{\Delta_{12}}}{\partial{w_i}} \\
&- \Delta_{10}\Delta_{20}\Delta_{21}\frac{\partial{\Delta_{11}}}{\partial{w_i}}
- \Delta_{20}\Delta_{20}\Delta_{11}\frac{\partial{\Delta_{21}}}{\partial{w_i}} \\
&-\Delta_{10}\Delta_{20}\Delta_{12}\frac{\partial{\Delta_{22}}}{\partial{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{22}\frac{\partial{\Delta_{12}}}{\partial{w_i}}\biggr]
\end{split}\end{equation}
\end{document}
答案4
我建议使用环境的另一种布局(只有 3 行)alignedat
。此外,使用包简化了偏导数的输入esdiff
:
\documentclass[a4paper]{article}
\usepackage{amsmath}
\usepackage{esdiff}
\begin{document}
\begin{equation}
\begin{alignedat}{2}
R_i=\Delta_x\Delta_y
\biggl[
& & \Delta_{1}\Delta_{2}\diffp{\Delta_{21}}{{w_i}}
+ \Delta_{1}\Delta_{2}\diffp{\Delta_{22}}{{w_i}}
+ \Delta_{2}\Delta_{1}\diffp{\Delta_{11}}{{w_i}}
+ \Delta_{2}\Delta_{1}\frac{∂{\Delta_{12}}}{∂{w_i}} &
\\
& & - \Delta_{10}\Delta_{20}\Delta_{21}\diffp{\Delta_{11}}{{w_i}}
- \Delta_{20}\Delta_{20}\Delta_{11}\diffp{\Delta_{21}}{{w_i}} &
\\
& & - \Delta_{10}\Delta_{20}\Delta_{12}\diffp{\Delta_{22}}{{w_i}}
- \Delta_{10}\Delta_{20}\Delta_{22}\diffp{\Delta_{12}}{{w_i}} &
\biggr]
\end{alignedat}
\end{equation}
\end{document}