![latex 排版使用 flalign 多行对齐](https://linux22.com/image/288561/latex%20%E6%8E%92%E7%89%88%E4%BD%BF%E7%94%A8%20flalign%20%E5%A4%9A%E8%A1%8C%E5%AF%B9%E9%BD%90.png)
我正在尝试将第二行方程对齐到第一行积分的下方。我该怎么做?我使用了 \right. 命令来移动到下一行。我不必使用 \vphantom{} 命令来保持括号的大小与讨论的相同幻影
\documentclass{article}
\usepackage{xfrac}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}
\begin{document}
\begin{flalign*}
=-\frac{Is'n}{2\pi}\mathbf{\hat{z}}\left[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}} {k}}\left(z-z'\right) \left(\left(x'+s\right) \int_0^{\frac{\pi}{2}}\frac{d\alpha} {\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right.\right. \\
\qquad \left.\left.-2x\int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1- h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right)\right]_{z'=-\sfrac{L} {2}}^{z'=+\sfrac{L}{2}}
\end{flalign*}\\
\end{document}
由于有括号,因此不允许使用 & 进行对齐。谢谢
答案1
我今天学到了很多东西,以前从来没有用过不同大小的括号。正如@barbarabeeton所说,alignat
如果你明确指定不匹配括号的大小,你就可以使用。
\documentclass{article}
\usepackage{xfrac}
\usepackage[fleqn]{amsmath}
\usepackage{mathtools}
\begin{document}
Your equation:
\begin{flalign*}
=-\frac{Is'n}{2\pi}\mathbf{\hat{z}}\left[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}} {k}}\left(z-z'\right) \left(\left(x'+s\right) \int_0^{\frac{\pi}{2}}\frac{d\alpha} {\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right.\right. \\
\qquad \left.\left.-2x\int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1- h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\right)\right]_{z'=-\sfrac{L} {2}}^{z'=+\sfrac{L}{2}}
\end{flalign*}\\
Simple example to show what I added
\begin{alignat}{1}
= a & b \notag \\
& c
\end{alignat}
Your equation in alignat
\begin{alignat*}{1}
= -\frac{Is'n}{2\pi}\mathbf{\hat{z}}\Biggl[\frac{1}{\frac{4xs'}{h}\frac{2\sqrt{xs'}} {k}}\left(z-z'\right) \Biggl(\left(x'+s\right) & \int_0^{\frac{\pi}{2}}\frac{d\alpha}{\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}} \notag \\
-2x & \int_0^{\frac{\pi}{2}}\frac{\sin^2\alpha\:d\alpha}{\left(1-h\sin^2\alpha\right)\sqrt{1-k^2\sin^2\alpha}}\Biggr)\Biggr]_{z'=-\sfrac{L} {2}}^{z'=+\sfrac{L}{2}}
\end{alignat*}
\end{document}
上面的输出如下所示