2

Please consider this MWE:

\documentclass{beamer}

\makeatletter \newcommand*{\overlaynumber}{\number\beamer@slideinframe} \makeatother

\usetheme{Copenhagen}

\begin{document}

\begin{frame} \begin{block}{} Text \begin{onlyenv}<1-2> \begin{enumerate} \setcounter{enumi}{1} \item Text \begin{columns}[T] \begin{column}{.5\linewidth} \begin{itemize} \item $n=0$ \end{itemize} \end{column} \begin{column}{.5\linewidth} \begin{itemize} \item $n=1$ \end{itemize} \end{column} \end{columns} \end{enumerate} \end{onlyenv}

    \begin{onlyenv}&lt;3-4&gt;
        \begin{enumerate}
            \setcounter{enumi}{2}
            \item PROBLEM WITH THIS ENUMERATE LABEL
            \begin{itemize}
                \item Text here
                \item More text here
            \end{itemize}
        \end{enumerate}
    \end{onlyenv}
\end{block}

\end{frame}

\end{document}

MWE output

As you can see, the third item is misplaced (the same happens with itemize environment).

I tried several things, but one thing came to my mind: What happens if we delete \usetheme{Copenhagen}? The item is well placed.

However I need that theme, and also the enumerate environments have to be separated in order to use onlyenv.

Perhaps adding \usepackage{enumitem} and moving that item to the right? I came across this excellent answer: "Don't use enumitem with beamer."

How can we solve this issue using the theme and preserving overlays?

manooooh
  • 3,203
  • 2
  • 21
  • 46

1 Answers1

1

You can avoid the problem by placing your columns after the itemize environment instead of at the end of it:

\documentclass{beamer}

\makeatletter \newcommand*{\overlaynumber}{\number\beamer@slideinframe} \makeatother

\usetheme{Copenhagen}

\begin{document}

\begin{frame} \begin{block}{} Text \begin{onlyenv}<1-2> \begin{enumerate} \setcounter{enumi}{1} \item Text \end{enumerate} \begin{columns}[T,onlytextwidth] \begin{column}{.5\linewidth} \begin{itemize} \item $n=0$ \end{itemize} \end{column} \begin{column}{.5\linewidth} \begin{itemize} \item $n=1$ \end{itemize} \end{column} \end{columns} \end{onlyenv}

    \begin{onlyenv}&lt;3-4&gt;
        \begin{enumerate}
            \setcounter{enumi}{2}
            \item PROBLEM WITH THIS ENUMERATE LABEL
            \begin{itemize}
                \item Text here
                \item More text here
            \end{itemize}
        \end{enumerate}
    \end{onlyenv}
\end{block}

\end{frame}

\end{document}