0

I know there are a lot of questions about text moving or jumping about in beamer but I didn't find an answer to this use case.

I have two columns with tcolorbox in one column. The righthand column jumps when I add more to the column. Here is a MWE:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{frametitle}[default][center]
\usepackage[many]{tcolorbox}
\usepackage{accents}
\usepackage{calc}
\def\scaletick{\resizebox{\widthof{\checkmark}*\ratio{\widthof{x}}{\widthof{\normalsize x}}}{!}{\checkmark}}
\newcommand{\ubar}[1]{\alt<+>{\underaccent{\bar}{#1}}{#1}}

\newsavebox\myboxa
\begin{lrbox}{\myboxa}
    \begin{tcolorbox}[text width=4.5cm, colback=blue!5!white]
\begin{semiverbatim}
a
a
a
a
a
a
a
a
a

\end{semiverbatim}
    \end{tcolorbox}
\end{lrbox}

\begin{document}

\begin{frame}{}
\begin{overlayarea}{\textwidth}{\textheight} 
\begin{columns}
\begin{column}{0.5\textwidth}
    \usebox\myboxa
\end{column}
%
\begin{column}{0.5\textwidth}  %%<--- here

Consider the the following.

\[
AA
\]

\vskip 0.5cm

\only<1>
{
$x = y$\\
$y = x$
}
\pause
\only<2>{
$x = y$\\
$y = x$
\vskip 0.5cm
Tada! \Huge{\scaletick} 
}
\end{column}
\end{columns}
    \end{overlayarea}
\end{frame}

\end{document}

How can this be fixed?

1 Answer 1

2

I'm not sure what is your desired result. Something like this?

enter image description here enter image description here

For above images I replace \only<...> with \uncover<...> and wrote equation so that they are follows vertically each other:

\documentclass{beamer}
\beamertemplatenavigationsymbolsempty
\setbeamertemplate{frametitle}[default][center]
\usepackage[many]{tcolorbox}
\usepackage{accents}
\usepackage{calc}
\def\scaletick{\resizebox{\widthof{\checkmark}*\ratio{\widthof{x}}{\widthof{\normalsize x}}}{!}{\checkmark}}
\newcommand{\ubar}[1]{\alt<+>{\underaccent{\bar}{#1}}{#1}}

\newsavebox\myboxa
\begin{lrbox}{\myboxa}
    \begin{tcolorbox}[text width=4.5cm, colback=blue!5!white]
\begin{semiverbatim}
a
a
a
a
a
a
a
a
a
\end{semiverbatim}
    \end{tcolorbox}
\end{lrbox}

\begin{document}

\begin{frame}
\frametitle{Demo}
\begin{columns}
\begin{column}{0.5\textwidth}
    \usebox\myboxa
\end{column}
%
\begin{column}{0.5\textwidth}  %%<--- here

Consider the following.

\[
AA
\]

\vskip 0.5cm

\uncover<1->
{
$x = y$\\
$y = x$\par
}
\pause
\uncover<2>{
$x = y$\\
$y = x$
\vskip 0.5cm
Tada! \Huge{\scaletick}
}
\end{column}
\end{columns}
\end{frame}

\end{document}

If you like to have that third math term is in the same line as is the second which is shown on the first slide, than remove \par after second equation.

1
  • \uncover instead of \only is the solution, thank you. The reason for the third math term is because I have a foreach loop and I want the final thing shown to be there for the next transition.
    – Simd
    Aug 20, 2020 at 15:56

You must log in to answer this question.

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