1

When using \only with LaTeXs beamer package, distances seem to change:

\documentclass{beamer}

\begin{document}

\begin{frame}[t]{} \begin{columns}[T] \fbox{% \begin{column}{0.6\textwidth} Test \only<-4>{[a]} \only<5>{[b]} \only<6>{[c]} \only<7>{[d]} \only<4->{\fbox{\textbf{Test}}} \only<5->{% \begin{itemize} \item b \only<6->{\item c} \only<7->{\item d} \end{itemize}} \end{column}} \fbox{% \begin{column}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image-a} \end{column}} \end{columns} \end{frame}

\end{document}

The second Test slides along from frame to frame (all slides overlayed):

image

What is happening here?

(P.S. And why are the columns not centered?)

Suuuehgi
  • 887
  • 4
  • 18

1 Answers1

1
  • the Test box moves because each line ending acts like a space. To avoid this, you can protect the line endings with a % sign

  • Beamer does not like other content in the columns environment other than columns. You can make the columns centred by moving the \fbox inside the columns:


\documentclass{beamer}

\begin{document}

\begin{frame}[t]{} \begin{columns}[T] \begin{column}{0.6\textwidth} \fbox{\begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule} Test \only<-4>{[a]}% \only<5>{[b]}% \only<6>{[c]}% \only<7>{[d]}% \only<4->{\fbox{\textbf{Test}}}% \only<5->{% \begin{itemize} \item b \only<6->{\item c} \only<7->{\item d} \end{itemize}}% \end{minipage}}% \end{column} \begin{column}{0.4\textwidth} \fbox{\includegraphics[width=\dimexpr\textwidth-2\fboxsep-2\fboxrule]{example-image-a}}% \end{column} \end{columns} \end{frame}

\end{document}

enter image description here