使用 \intertext{ 时 \begin{align}... \end{align} 内的 \resizebox 不起作用

使用 \intertext{ 时 \begin{align}... \end{align} 内的 \resizebox 不起作用

我在证明环境中有一些非常宽的方程式,我想将它们包含在一个双列文档中,因此我想到使用 \resizebox{1.3\columnwidth}{!}{% 来存档,这会生成此错误消息“包 amsmath 错误:\intertext{ 使用无效”,如下面的 MWE1 所示。

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}

\usepackage{multicol}% set this to 2 colomn
\setlength{\columnsep}{7mm}% set the space betw colomn 7mm

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}

\usepackage{ulem}
\newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}}

\newcommand{\numberthis}{\refstepcounter{equation}\tag{\arabic{equation}}}
\newcommand{\labeln}[1]{\numberthis\label{#1}}
\newcommand{\mathonehalf}{\ensuremath{\frac{1}{2}}}

\usepackage{blindtext}
\begin{document}
\begin{multicols}{2}
\blindtext
\blindtext
\begin{proof}
\resizebox{1.3\columnwidth}{!}{%
$\begin{aligned}
\vartriangle Y=& \dfrac{n!}{\left(n-X-1\right)!\,X+1!}\left(\tfrac{1}{2}
n\right)\left(\tfrac{1}{2} \sqrt{n}\right) \nonumber\\
&\,- \dfrac{n!}{\left(n-X\right)!\,X!}\left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right) \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)n!\nonumber\\
&\,\left[\dfrac{\left(n-x\right)!\,x!-\left(n-x-1\right)!\left(n-x\right)!}{\left(n-x-1\right)!\left(n-x\right)!\,\left(n-x\right)!\,x!}\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2}
\sqrt{n}\right)n!\nonumber\\
&\,\left[\dfrac{\msout{\mathsf{\left(n-x-1\right)!\,x!}}\left[\left(n-x\right)-\left(x+1\right)\right]}{\msout{\mathsf{\left(n-x-1\right)!}}\left(x+1\right)!\,\left(n-x\right)!\,\msout{\mathsf{x!}}}\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)\left[\dfrac{n!}{\left(x+1\right)!\,\left(n-x\right)!}\right]
\nonumber\\
&\,\left[\left(n-x\right)-\left(x+1\right)\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)
\left[\dfrac{n!}{\left(n-x\right)!\,x!}\right]\nonumber\\
&\,\dfrac{\left(n-x-x-1\right)}{\left(x+1\right)} \nonumber\\
\intertext{From equation \ref{eq:dz} and equation \eqref{eq:sigma} }\\
\end{aligned}$ 
}
\end{proof}

References to $\sigma$ \eqref{eq:sigma} and $\Delta Z$ \eqref{eq:dz}.
\blindtext
\end{multicols}
\end{document}

即使我使用 \begin{align}...\end{align},它也显示数学不在数学模式,如下面的 MWE2 所示。

\documentclass[12pt,a4paper]{article}
\usepackage[latin1]{inputenc}

\usepackage{multicol}% set this to 2 colomn
\setlength{\columnsep}{7mm}% set the space betw colomn 7mm

\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[left=2.00cm, right=2.00cm, top=2.00cm, bottom=2.00cm]{geometry}

\usepackage{ulem}
\newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}}

\newcommand{\numberthis}{\refstepcounter{equation}\tag{\arabic{equation}}}
\newcommand{\labeln}[1]{\numberthis\label{#1}}
\newcommand{\mathonehalf}{\ensuremath{\frac{1}{2}}}

\usepackage{blindtext}
\begin{document}
\begin{multicols}{2}
\blindtext
\blindtext
\begin{proof}
\resizebox{1.3\columnwidth}{!}{%
\begin{align}
\vartriangle Y=& \dfrac{n!}{\left(n-X-1\right)!\,X+1!}\left(\tfrac{1}{2}
n\right)\left(\tfrac{1}{2} \sqrt{n}\right) \nonumber\\
&\,- \dfrac{n!}{\left(n-X\right)!\,X!}\left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right) \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)n!\nonumber\\
&\,\left[\dfrac{\left(n-x\right)!\,x!-\left(n-x-1\right)!\left(n-x\right)!}{\left(n-x-1\right)!\left(n-x\right)!\,\left(n-x\right)!\,x!}\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2}
\sqrt{n}\right)n!\nonumber\\
&\,\left[\dfrac{\msout{\mathsf{\left(n-x-1\right)!\,x!}}\left[\left(n-x\right)-\left(x+1\right)\right]}{\msout{\mathsf{\left(n-x-1\right)!}}\left(x+1\right)!\,\left(n-x\right)!\,\msout{\mathsf{x!}}}\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)\left[\dfrac{n!}{\left(x+1\right)!\,\left(n-x\right)!}\right]
\nonumber\\
&\,\left[\left(n-x\right)-\left(x+1\right)\right] \nonumber\\
=& \left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right)
\left[\dfrac{n!}{\left(n-x\right)!\,x!}\right]\nonumber\\
&\,\dfrac{\left(n-x-x-1\right)}{\left(x+1\right)} \nonumber\\
\intertext{From equation \ref{eq:dz} and equation \eqref{eq:sigma} }\\
\end{align}
}
\end{proof}

References to $\sigma$ \eqref{eq:sigma} and $\Delta Z$ \eqref{eq:dz}.
\blindtext
\end{multicols}
\end{document}

我想在证明环境中使用文本,并且还想使用 \resizebox{ 命令,同时保持数学部分对齐但不对齐文本部分。

答案1

无需使用\resizebox大锤。只需删除所有 39 对\left\right,即可节省大量空间。仅在需要时使用\bigl\bigr\biggl。通过使用环境,您可以直接删除所有这些。\biggralign*\nonumber

顺便说一句,您的代码有时使用x,有时使用X。有区别吗?

在此处输入图片描述

\documentclass[12pt,a4paper]{article}
\usepackage{multicol}% set this to 2 colomn
\setlength{\columnsep}{7mm}% set the space between columns to 7mm

\usepackage{amsmath,amsthm,amssymb}
%\allowdisplaybreaks  % use only if necessary
\usepackage[margin=2cm]{geometry}

\usepackage{ulem}
\newcommand{\msout}[1]{\text{\sout{\ensuremath{#1}}}}

\newcommand{\numberthis}{\refstepcounter{equation}\tag{\arabic{equation}}}
\newcommand{\labeln}[1]{\numberthis\label{#1}}
\newcommand{\mathonehalf}{\ensuremath{\frac{1}{2}}}

\usepackage{blindtext}
\begin{document}

\begin{multicols}{2}
\blindtext
\blindtext
\begin{proof}
\begin{align*}
\Delta Y
&= \frac{n!}{(n-X-1)!\,X+1!}
   \bigl(\tfrac{1}{2}n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr) \\
&\quad - \frac{n!}{(n-X)!\,X!}
   \bigl(\tfrac{1}{2} n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr) \\
&= \bigl(\tfrac{1}{2} n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr) n!\\
&\quad\times\biggl[\frac{(n-x)!\,x!-(n-x-1)!\,(n-x)!}{(n-x-1)!\,(n-x)!\,(n-x)!\,x!}\biggr] \\
&= \bigl(\tfrac{1}{2} n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr) n!\\
&\quad\times\biggl[\frac{\msout{\mathsf{(n-x-1)!\,x!}}[(n-x)-(x+1)]}{\msout{\mathsf{(n-x-1)!}}\,(x+1)!\,(n-x)!\,\msout{\mathsf{x!}}}\biggr] \\
&= \bigl(\tfrac{1}{2} n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr) \sqrt{n})
   \biggl[\frac{n!}{(x+1)!\,(n-x)!}\biggr] \\
&\quad\times[(n-x)-(x+1)] \\
&= \bigl(\tfrac{1}{2} n\bigr)\bigl(\tfrac{1}{2} \sqrt{n}\,\bigr)
   \biggl[\frac{n!}{(n-x)!\,x!}\biggr]\\
&\quad\times\frac{(n-x-x-1)}{(x+1)} 
\end{align*}
from equations \eqref{eq:dz} and \eqref{eq:sigma}.
\end{proof}

References to $\sigma$ \eqref{eq:sigma} and $\Delta Z$ \eqref{eq:dz}.

\end{multicols}
\end{document}

相关内容