缩小对齐方程以适合页面宽度

缩小对齐方程以适合页面宽度

我读过几个类似的问题,但没有一个是关于对齐环境的。这是我的例子。

\documentclass{article}

\usepackage{amsfonts}
\usepackage{amsmath}

\begin{document}

\noindent where $B(a, b) := \int_{0}^{1} y^{a-1}(1-y)^{b-1} dy$. When $\xi<0$, similar calculations induce the same results. Hence, the first and second moments of $X_{i:n}$  corresponding to a GP random variable are as follows.
\begin{align*}
\mathbb EX_{i:n}   &= \frac{\sigma}{\xi} \frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i)- B(n-i+\xi+1, i)]. \\ 
\mathbb EX_{i:n}^2 &= \left(\frac{\sigma}{\xi}\right)^2\frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i) -2B(n-i+\xi+1, i) + B(n-i+2\xi+1, i)].
\end{align*}

\end{document}

请问我该如何缩小第二个表达式,使其仍然与等号对齐,但宽度与上方的文本相同?谢谢!

在此处输入图片描述

答案1

在这里,我将最后一个术语堆叠在倒数第二个术语之下,行间留有 5pt 的间隙,并左对齐。

\documentclass{article}

\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{stackengine}
\stackMath
\def\stackalignment{l}

\begin{document}

\noindent where $B(a, b) := \int_{0}^{1} y^{a-1}(1-y)^{b-1} dy$. When $\xi<0$, similar calculations induce the same results. Hence, the first and second moments of $X_{i:n}$  corresponding to a GP random variable are as follows.
\begin{align*}
\mathbb EX_{i:n}   &= \frac{\sigma}{\xi} \frac{n!}{(i-1)!(n-i)!} 
  [B(n-i+1, i)- B(n-i+\xi+1, i)]. \\ 
\mathbb EX_{i:n}^2 &= \left(\frac{\sigma}{\xi}\right)^2\frac{n!}{(i-1)!(n-i)!} 
  [B(n-i+1, i) \stackunder[5pt]{{}-2B(n-i+\xi+1, i)}{ {}+ B(n-i+2\xi+1, i)].}
\end{align*}

\end{document}

在此处输入图片描述


尽管受到警告,原帖作者还是希望将第二个方程缩小以适应。如果将缩小范围限制在第二个方程的右侧,则可以按如下方式进行,将方程的该部分放在 中\text{\footnotesize$...$}

\documentclass{article}

\usepackage{amsfonts}
\usepackage{amsmath}
\begin{document}

\noindent where $B(a, b) := \int_{0}^{1} y^{a-1}(1-y)^{b-1} dy$. When $\xi<0$, similar calculations induce the same results. Hence, the first and second moments of $X_{i:n}$  corresponding to a GP random variable are as follows.
\begin{align*}
\mathbb EX_{i:n}   &= \frac{\sigma}{\xi} \frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i)- B(n-i+\xi+1, i)]. \\ 
\mathbb EX_{i:n}^2 &= \text{\footnotesize$\left(\frac{\sigma}{\xi}\right)^2\frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i) -2B(n-i+\xi+1, i) + B(n-i+2\xi+1, i)].$}
\end{align*}

\end{document}

在此处输入图片描述


另外一种选择是,可以将整个方程变成脚注大小,如下所示{\footnotesize\begin{align}...\end{align}\par}

\documentclass{article}

\usepackage{amsfonts}
\usepackage{amsmath}
\begin{document}

\noindent where $B(a, b) := \int_{0}^{1} y^{a-1}(1-y)^{b-1} dy$. When $\xi<0$, similar calculations induce the same results. Hence, the first and second moments of $X_{i:n}$  corresponding to a GP random variable are as follows.
{\footnotesize
\begin{align*}
\mathbb EX_{i:n}   &= \frac{\sigma}{\xi} \frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i)- B(n-i+\xi+1, i)]. \\ 
\mathbb EX_{i:n}^2 &= \left(\frac{\sigma}{\xi}\right)^2\frac{n!}{(i-1)!(n-i)!} [B(n-i+1, i) -2B(n-i+\xi+1, i) + B(n-i+2\xi+1, i)].
\end{align*}\par}

\end{document}

在此处输入图片描述

相关内容