7

How to make a big equation fit in a single slide?

I have the following equation:

\begin{frame}

\begin{equation}
        \begin{split}
        (\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l) 
        \\
        \implies \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0
        \\
    \implies \bigg \{ 2\lambda_1-\bigg(3n-6-\sqrt{8l+n^2-4n+4}\bigg )\bigg \}\bigg \{ 2\lambda_1-\bigg(3n-6+\sqrt{8l+n^2-4n+4}\bigg)\bigg \} \leq 0
        \\
        \implies  \frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}\leq \lambda_1 \leq \frac{3n-6+\sqrt{8l+n^2-4n+4}}{2}
        \end{split}
        \end{equation}

\end{frame}

Whenever I am using \begin{frame} \end{frame} a part of my equation is going outside the frame.

How can I adjust the whole equation in a single slide?

Please help me out.

0

5 Answers 5

7

Here's a solution suggestion that performs alignment on the inequality symbols.

Aside: The \bigg sizing instructions are, in my opinion, excessive; \big and \Big suffice completely.

enter image description here

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{equation}
\begin{aligned}
(\lambda_1-2n+l+4)(\lambda_1-n-l+2) &\leq l(n-l) \\
\implies \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8) &\leq 0\\
\implies \Bigl\{ 2\lambda_1-\bigl(3n-6-\sqrt{8l+n^2-4n+4}\,\bigr )\Bigr \} \quad&\\
\times\Bigl\{ 2\lambda_1-\bigl(3n-6+\sqrt{8l+n^2-4n+4}\,\bigr)\Bigr\} &\leq 0 \\
\implies  \frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}&\leq \lambda_1\\
\text{and}\quad 
\frac{3n-6+\sqrt{8l+n^2-4n+4}}{2} &\geq \lambda_1\\
\end{aligned}
\end{equation}

\end{frame}
\end{document}

Addendum: Here's a second solution, inspired by @egreg's observation that a lot of space is taken up by the repeated term \sqrt{8l+n^2-4n+4}. Replacing it with the symbol D, rewriting the final row to use interval notation instead of a pair of inequalities, and aligning the rows on the \implies symbols instead of on the inequality symbols yields the following result:

enter image description here

\documentclass{beamer}
\begin{document}
\begin{frame}

\begin{equation}
\begin{aligned}[b]
&(\lambda_1-2n+l+4)(\lambda_1-n-l+2) \leq l(n-l)\\
\implies&\lambda_1^2-\lambda_1(3n-6)+(2n^2-2l-8n+8)\leq 0\\
\implies&\bigl( 2\lambda_1-(3n-6-D) \bigr) 
         \bigl( 2\lambda_1-(3n-6+D) \bigr) \leq 0 \\
\implies&\lambda_1\in\bigl[
         (\tfrac{3}{2}n-3)-\tfrac{1}{2}D, 
         (\tfrac{3}{2}n-3)+\tfrac{1}{2}D \bigr]
\end{aligned}
\end{equation}
where $D=\sqrt{(n-2)^2+8l}$\,.

\end{frame}
\end{document}
2
  • wanted to know , why do we use \quad&
    – Charlotte
    Feb 2, 2020 at 14:02
  • @Math_Freak - The single use of \quad pushes the first row of the two-row equation slightly to the left. The (intended) visual effect is to make clear that the absence of an equality symbol in that row isn't accidental. Without the \quad, the expressionsin curly braces would be perfectly aligned, maybe raising some questions in readers' minds as to what's going on.
    – Mico
    Feb 2, 2020 at 14:06
9

Much of the horizontal space is taken by the long square roots. Always presume that your audience is able to read, so you can use an abbreviation.

\documentclass{beamer}
\usepackage{mathtools}

\begin{document}

\begin{frame}

\begin{align}
& (\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l) \notag
\\
\implies\quad
& \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0 \notag
\\
\implies\quad
& \Bigl \{ 2\lambda_1-\bigl(3n-6-\sqrt{D}\,\bigr)\Bigr\}
  \Bigl \{ 2\lambda_1-\bigl(3n-6+\sqrt{D}\,\bigr)\Bigr \} \leq 0 \notag
\\
\implies\quad
& \frac{3n-6-\sqrt{D}}{2}\leq \lambda_1 \leq \frac{3n-6+\sqrt{D}}{2} \label{whatever}
\end{align}
where $D=8l+n^2-4n+4$.

\end{frame}

\end{document}

A vertically centered equation number would be very ambiguous, so I chose to set it at the bottom. I also reduced the size of the parentheses; note the \, to separate the vinculum from the closing parenthesis.

enter image description here

In case of need, the middle long equation could be split using multlined (this is why I loaded mathtools.

\documentclass{beamer}
\usepackage{mathtools}

\begin{document}

\begin{frame}

\begin{align}
& (\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l) \notag
\\
\implies\quad
& \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0 \notag
\\
\implies\quad
& \begin{multlined}[t]
  \Bigl \{ 2\lambda_1-\bigl(3n-6-\sqrt{D}\,\bigr)\Bigr\} \\
  \cdot \Bigl \{ 2\lambda_1-\bigl(3n-6+\sqrt{D}\,\bigr)\Bigr \} \leq 0 
  \end{multlined} \notag
\\
\implies\quad
& \frac{3n-6-\sqrt{D}}{2}\leq \lambda_1 \leq \frac{3n-6+\sqrt{D}}{2} \label{whatever}
\end{align}
where $D=8l+n^2-4n+4$.

\end{frame}

\end{document}

enter image description here

Finally, with the text typeset in sans serif, I'd avoid “l” as a variable.

1
  • 1
    You just taught me the word "vinculum". Cool. Feb 3, 2020 at 7:44
4

Inside a split you can specify an alignment point for each row using &, this greatly enhances the legibility of multi-line equations. Also, you'd have to split the very long lines into two lines as well. In the following I did so and move those continuing lines further to the right using \qquad.

\documentclass[]{beamer}

\usepackage[]{amsmath}

\begin{document}
\begin{frame}
\begin{equation}
  \begin{split}
    &(\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l)
      \\
    \implies &\lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0
      \\
    \implies &\bigg \{ 2\lambda_1-\bigg(3n-6-\sqrt{8l+n^2-4n+4}\bigg )\bigg \}
      \\
      &\qquad\cdot\bigg \{ 2\lambda_1-\bigg(3n-6+\sqrt{8l+n^2-4n+4}\bigg)\bigg \} \leq 0
      \\
    \implies  &\frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}
      \\
    &\qquad\leq \lambda_1 \leq \frac{3n-6+\sqrt{8l+n^2-4n+4}}{2}
  \end{split}
\end{equation}

\end{frame}
\end{document}

enter image description here

3

A possibility with the gathered environment, and spreadlines from mathtools:

\documentclass{beamer}
\usepackage{amssymb}
\usepackage{mathtools}

\begin{document}

\begin{frame}

\begin{equation}
\begin{spreadlines}{-0.2ex}
 \begin{gathered}
 (\lambda_1-2n+l+4)(\lambda_1-n-l+2) \leq s l(n-l) \\
\Downarrow\\
  \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0 \\
\Downarrow \\
    \Bigl\{2\lambda_1-\Bigl(3n-6-\sqrt{8l+n^2-4n+4}\Bigr)\Bigr\}\cdot{}\qquad \\[0.5ex]
  \qquad{}\cdot\Bigl\{2\lambda_1-\Bigl(3n-6+\sqrt{8l+n^2-4n+4}\Bigr)\Bigr\}\leq 0 \\
\Downarrow \\
\mathclap{\frac{3n-6-\sqrt{8l+n^2-4n+4}}{2} \leq \lambda_1 \leq \frac{3n-6+\sqrt{8l+n^2-4n+4}}{2}}\\
  \end{gathered}
  \end{spreadlines}
 \end{equation}

\end{frame}

\end{document} 

enter image description here

0

I haven't add anything to the OP. Just make the align correct by shrinking the frame and re-positioning the & inside the align environment.

Hope this helps.

\documentclass{beamer}
\usepackage{amsmath}
\begin{document}
\begin{frame}[shrink=35]

\begin{equation}
\centering
\begin{split}
(\lambda_1-2n+l+4)(\lambda_1-n-l+2)\leq l(n-l) 
    &\\
    &\\\implies \lambda_1^2+\lambda_1(6-3n)+(2n^2-2l-8n+8)\leq 0
    &\\
&\\\implies \bigg \{ 2\lambda_1-\bigg(3n-6-\sqrt{8l+n^2-4n+4}\bigg )\bigg \}\bigg \{ 2\lambda_1-\bigg(3n-6+\sqrt{8l+n^2-4n+4}\bigg)\bigg \} \leq 0
    &\\
    &\\\implies  \frac{3n-6-\sqrt{8l+n^2-4n+4}}{2}\leq \lambda_1 \leq \frac{3n-6+\sqrt{8l+n^2-4n+4}}{2}
    \end{split}
    \end{equation}
\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .