我想创建一个如下所示的布局,但更加自动化,这样我就不必在每种情况下手动调整间距(如下所示)。
谁知道该怎么做?
\documentclass{minimal}
\usepackage{amsmath}
\begin{document}
\begin{align}
I(a,b) &= \int_0^{\pi/2}\frac{d\Phi}{\sqrt{a^2\cos^2(\Phi)+b^2\sin^2(\Phi)}}\nonumber\\[-4ex]
&\hspace*{1mm}\left|\begin{aligned}&~\\[3ex]
\hline\\[-2ex]
~~&\text{Substitution } \boxed{t = b\cdot \tan \Phi}:\qquad 0 < t < \infty\\
&\frac{dt}{d\Phi} = b\cdot(1+\tan^2\Phi)=b+\frac{t^2}{b}=\frac{t^2+b^2}{b}\quad\Longrightarrow\quad\frac{d\Phi}{dt} = \frac{b}{t^2+b^2}\\
&1+\tan^2\Phi = \frac{1}{\cos^2\Phi} \quad\Longrightarrow\quad \cos^2\Phi = \frac{b^2}{b^2+b^2\tan^2\Phi}=\frac{b^2}{b^2+t^2}\\
&\sin^2\Phi = 1- \cos^2\Phi = \frac{b^2+t^2-b^2}{b^2+t^2} = \frac{t^2}{b^2+t^2}\\[2ex]
\hline\\[2ex]
\end{aligned}\right.\nonumber\\[-2ex]
&= \int_0^{\infty} \frac{1}{\sqrt{a^2\cdot\frac{b^2}{b^2+t^2} + b^2\cdot\frac{t^2}{b^2+t^2}}}\cdot\frac{b}{t^2+b^2} dt\nonumber
\end{align}
\end{document}
答案1
这会自动完成但是你真的喜欢这个布局吗?
\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{align}
I(a,b) &\tikzmarknode{eq1}{=}
\int\limits_0^{\pi/2}\frac{\mathrm{d}\Phi}{\sqrt{a^2\cos^2(\Phi)+b^2\sin^2(\Phi)}}
\notag\\
&\quad\begin{array}{>{\displaystyle}l}
\hline
\text{Substitution } \boxed{t = b\cdot \tan \Phi}:\qquad 0 < t < \infty\\
\frac{\mathrm{d}t}{\mathrm{d}\Phi} = b\cdot(1+\tan^2\Phi)=b+\frac{t^2}{b}=\frac{t^2+b^2}{b}
\quad\Longrightarrow\quad\frac{\mathrm{d}\Phi}{\mathrm{d}t} = \frac{b}{t^2+b^2}\\
1+\tan^2\Phi = \frac{1}{\cos^2\Phi} \quad\Longrightarrow\quad \cos^2\Phi = \frac{b^2}{b^2+b^2\tan^2\Phi}=\frac{b^2}{b^2+t^2}\\
\sin^2\Phi = 1- \cos^2\Phi = \frac{b^2+t^2-b^2}{b^2+t^2} = \frac{t^2}{b^2+t^2}
\\ \hline
\end{array}\notag\\
&\tikzmarknode{eq2}{=} \int\limits_0^{\infty} \frac{1}{\sqrt{a^2\cdot\frac{b^2}{b^2+t^2} + b^2\cdot\frac{t^2}{b^2+t^2}}}\cdot\frac{b}{t^2+b^2}
\,\mathrm{d}t
\end{align}\tikz[overlay,remember picture]{\draw[shorten >=1pt,shorten <=1pt] (eq1) -- (eq2);}
\end{document}