2

I have some very wide equations within a proof environment which I want to contain in a two-column document, I thus think of using \resizebox{1.3\columnwidth}{!}{% to archive that generate this error message "package amsmath error: invalid use of \intertext{" as seen in MWE1 below.

\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}

Even when I use \begin{align}...\end{align} it shows that the maths is not in maths mode as seen in MWE2 below.

\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}

I want to use texts within the proof environment and also want to use the\resizebox{ command while I keep the mathematical part align but not aliging the text part.

2
  • intertext is designed for display environments such as align not inline aligned but don't use \resizebox with text, especially not mathematics, just choose a smaller font size such as \small Jun 27, 2018 at 21:33
  • Your second code example, even after adding the instruction `\usepackage{graphicx}, crashes. Please fix.
    – Mico
    Jun 27, 2018 at 21:36

1 Answer 1

2

No need to use the \resizebox sledge hammer. Just get rid of all 39 pairs of \left and \right, and you'll save a surprising amount of space. Use \bigl, \bigr, \biggl and \biggr only where needed. By using an align* environment, you can get rid of all those \nonumber directly.

Incidentally, your code sometimes uses x, and sometimes it uses X. Is there a difference?

enter image description here

\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}
2
  • Incidentally, do note that I replaced \vartriangle Y with \Delta Y. Do let me know if this replacement is inappropriate.
    – Mico
    Jun 27, 2018 at 22:11
  • x and X issue is a typo error, what I want is small letter x
    – economia
    Jun 28, 2018 at 3:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.