3

I am preparing slides using beamer. However, my equation has exceeded the page margin. I have tried several solutions given on this website, but with those solutions, my .tex file is not compiling. Here is the code of my original beamer slide:

\documentclass{beamer}
\usepackage[english]{babel}
\usefonttheme[onlymath]{serif}
\usepackage{color}
\usepackage{graphicx}
\usepackage{amssymb,amsmath}
\usepackage{tikz}
\usepackage{epstopdf}
\begin{document}

\begin{frame}

\begin{itemize}

\item whenever $k$ is of the form $2^i$, where $i\in\mathbb{N}$, then

\begin{equation}
0.5(\sqrt[3]{n+\sqrt{n^2-1/27}}+ \sqrt[3]{n-\sqrt{n^2-1/27}})
\leq k < 0.125 (\sqrt{n}+\sqrt{n+16(\sqrt{n}+1)})
\end{equation}

\end{itemize}

\end{frame}

\end{document}

And I am getting the following output:enter image description here

Please help me resolve this issue!

2
  • Restructure your equation. Either use variables for identical subformula (for instance you could define x = \sqrt{n^2 - 1/27}), or introduce line breaks (there are environments for multi line maths, like align, split, ...).
    – Skillmon
    Commented Jul 14, 2023 at 22:49
  • Off-topic: What's the relationship between k and n?
    – Mico
    Commented Jul 14, 2023 at 23:15

1 Answer 1

4

I suggest you make two, separate changes. First, use an environment such as multline instead of equation to make it possible to introduce a line break right before \leq k. Second, use \Bigl( and \Bigr) for the "outer" parentheses in both rows.

enter image description here

\documentclass{beamer}
\usefonttheme[onlymath]{serif}

\begin{document}
\begin{frame}
\begin{itemize}

\item If $k$ is of the form $2^i$, where $i\in\mathbb{N}$, then
\begin{multline}
0.5\Bigl(\sqrt[3]{n+\sqrt{n^2-1/27}}+ \sqrt[3]{n-\sqrt{n^2-1/27}}\,\Bigr) \\
\leq k < 0.125 \Bigl(\sqrt{n}+\sqrt{n+16(\sqrt{n}+1)}\,\Bigr)
\end{multline}

\end{itemize}
\end{frame}
\end{document}

You must log in to answer this question.

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