0

I need you help me with hacks or tricks to include my MWE in a two-column page with the proof environment with its mathematical being aligned and also consist texts for explanation. The problem is that it goes out of column spase when I ran it. I want it contained in a two column page document.

\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}
    \begin{align}
    \mu &= np \\
    &= \mathonehalf n;\\
    \sigma &= \sqrt{np\left(1-p\right)} \labeln{eq:sigma}\\
    &=  \mathonehalf \sqrt{n};\\
    Z &= \dfrac{X-\mu}{\sigma}\\
    &= \frac{X-\mathonehalf n}{\mathonehalf \sqrt{n}};\\
    \vartriangle Z&= \frac{\left(X+1\right)-\mathonehalf n}{\mathonehalf 
        \sqrt{n}} - \frac{X-\mathonehalf n}{\mathonehalf \sqrt{n}}\\
    \vartriangle Z&= \dfrac{1}{\mathonehalf \sqrt{n}} \labeln{eq:dz}\\
    \lim_{n \to \infty} \vartriangle Z &= 0 \labeln{eq:limdz}\\
    \vartriangle Y&= \dfrac{n!}{\left(n-X-1\right)!\,X+1!}\left(\tfrac{1}{2} n\right)\left(\tfrac{1}{2} \sqrt{n}\right) - \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!\,\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!\,\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]\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]\dfrac{\left(n-x-x-1\right)}{\left(x+1\right)} \nonumber\\
    \text{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}
  • How about just changing \text to \intertext? (I am afraid your equations are still too wide after that, though.) – user121799 Jun 27 '18 at 19:07
  • You're missing a \\ before vartriangle Y, but how do you think that a formula that exceeds the column width by 138pt can fit? – egreg Jun 27 '18 at 19:09
2

You can use \intertext for the text. Apart from that, you can get rid of the overfull \hboxes by not aligning all equations and also splitting some of the righthand sides into two lines. The result is still not very appealing, mostly because your expressions are too bulky to be put into such narrow space.

\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}
    \begin{align}
    \mu =& np \\
    =& \mathonehalf n;\\
    \sigma =& \sqrt{np\left(1-p\right)} \labeln{eq:sigma}\\
    =&  \mathonehalf \sqrt{n};\\
    Z =& \dfrac{X-\mu}{\sigma}\\
    =& \frac{X-\mathonehalf n}{\mathonehalf \sqrt{n}};\\
    \vartriangle Z=& \frac{\left(X+1\right)-\mathonehalf n}{\mathonehalf 
        \sqrt{n}} - \frac{X-\mathonehalf n}{\mathonehalf \sqrt{n}}\\
    \vartriangle Z=& \dfrac{1}{\mathonehalf \sqrt{n}} \labeln{eq:dz}\\
    \lim_{n \to \infty} \vartriangle Z =& 0 \labeln{eq:limdz}
\end{align}
    \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}

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.