0

I have one problem with multi-slides. as you see below, I define some columns and "onlyenv". I put some minipages in this columns for organizing them into my language package. This type of slides is good for me. But when I change the multi-slides in slides, the position of my minipage contents changes. While my contents in multi-slides are the same. How can it be solved? the MWE code is as below:

\documentclass{beamer}
\usepackage{tikz}

 \usepackage{xcolor}

\definecolor{tuelightblue}{cmyk}{0.2, 0.15, 0.04,  0.0}
\definecolor{tueblue}{cmyk}{1.0, 0.93, 0.18, 0.05}
\definecolor{tuepurple}{cmyk}{0.14, 0.97, 0.51, 0.01}
\definecolor{babypink}{rgb}{0.96, 0.76, 0.76}


\tikzset{onslide/.code args={<#1>#2}{%
  \only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path
}}
\begin{document}
\section{first}
\begin{frame}
\begin{columns}[onlytextwidth]
 \vrule{}
    \begin{onlyenv}<1>
        \begin{column}{.85\textwidth}
    \begin{minipage}{1\textwidth}
text here
\end{minipage}
    \begin{figure}
\begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 5000}
\end{minipage}
\begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 10000}
\end{minipage}
\end{figure} 
\end{column}  
    \end{onlyenv}
    \begin{onlyenv}<2>
        \begin{column}{.85\textwidth}
    \begin{minipage}{1\textwidth}
text here
 \end{minipage}
     \begin{figure}
\begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 5000}
\end{minipage}
\begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 10000}
\end{minipage}
\end{figure}
\end{column}   
    \end{onlyenv}   
    \begin{onlyenv}<3>
    \begin{column}{.85\textwidth}
    \begin{minipage}{1\textwidth}
 text here
 \end{minipage}
      \begin{figure}
 \begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 5000}
 \end{minipage}
\begin{minipage}{.475\textwidth}
  \includegraphics[width=\linewidth]{dimpprot10000.pdf}
  \caption{reynolds 10000}
\end{minipage}
\end{figure} 
\end{column}
    \end{onlyenv}
       \vrule{}
    \begin{column}{.15\textwidth}
    \begin{center}
        \begin{tikzpicture}
        \node[onslide=<1>{fill=tuepurple},onslide=    <2->{fill=tuelightblue},circle,text width=0.5cm,align=center,inner     sep=1pt,minimum size=1.3cm]{\footnotesize{text one}};
         \end{tikzpicture}
        \begin{tikzpicture}
        \node[onslide=<2>{fill=tuepurple},onslide=    <1>{fill=tuelightblue},onslide=<3>{fill=tuelightblue},circle,text     width=0.5cm,align=center,inner sep=1pt,minimum size=1.3cm]    {\footnotesize{text two}};
        \end{tikzpicture}       
       \begin{tikzpicture}
        \node[onslide=<3>{fill=tuepurple},onslide=<-2>{fill=tuelightblue},circle,text width=0.5cm,align=center,inner sep=1pt,minimum size=1.3cm]{\footnotesize{text three}};
        \end{tikzpicture}  
    \end{center}  
    \end{column}
     \vrule{}
 \end{columns}

 \end{frame}
 \end{document}
3
  • I am afraid, I don't understand the question. Can you maybe add a picture and mark what should be changed? Commented Feb 25, 2018 at 15:31
  • Thank you, Mr. Carter. the following images are attached for saying my problem. If you compare the images, we have a horizontal shift between images to the right side. This shift is obvious in the text. by the way, if you run the above code, you find it better. !slide1 !slide2 !slide3 Commented Feb 25, 2018 at 18:42
  • Oh, I think I now understand the question! BTW please don't call me Mr. :) Commented Feb 25, 2018 at 19:50

1 Answer 1

1
  • to fix the problem with the horizontal alignment, change the order of column and onlyenv

  • xcolor is not necessary with beamer

  • \footnotesize is a switch and does not take arguments. This means \footnotesize{bla} should be {\footnotesize bla}


\documentclass{beamer}
\usepackage{tikz}

% \usepackage{xcolor}

\definecolor{tuelightblue}{cmyk}{0.2, 0.15, 0.04,  0.0}
\definecolor{tueblue}{cmyk}{1.0, 0.93, 0.18, 0.05}
\definecolor{tuepurple}{cmyk}{0.14, 0.97, 0.51, 0.01}
\definecolor{babypink}{rgb}{0.96, 0.76, 0.76}

\tikzset{onslide/.code args={<#1>#2}{%
\only<#1>{\pgfkeysalso{#2}} % \pgfkeysalso doesn't change the path
}}

\begin{document}

\section{first}

\begin{frame}
    \begin{columns}[onlytextwidth]
        \vrule{}%
        \begin{column}{.85\textwidth}%
            \begin{onlyenv}<1>%
                \begin{minipage}{1\textwidth}%
                    text here%
                \end{minipage}%
                \begin{figure}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 5000}%
                    \end{minipage}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 10000}%
                    \end{minipage}%
                \end{figure}%
            \end{onlyenv}%
            \begin{onlyenv}<2>%
                \begin{minipage}{1\textwidth}%
                    text here%
                \end{minipage}%
                \begin{figure}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 5000}%
                    \end{minipage}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 10000}%
                    \end{minipage}%
                \end{figure}%
            \end{onlyenv}%          
            \begin{onlyenv}<3>%
                \begin{minipage}{1\textwidth}%
                    text here%
                \end{minipage}%
                \begin{figure}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 5000}%
                    \end{minipage}%
                    \begin{minipage}{.475\textwidth}%
                        \includegraphics[width=\linewidth]{example-image}%
                        \caption{reynolds 10000}%
                    \end{minipage}%
                \end{figure}%
            \end{onlyenv}%
        \end{column}
        \vrule{}
        \begin{column}{.15\textwidth}
            \begin{center}
                \begin{tikzpicture}
                    \node[onslide=<1>{fill=tuepurple},onslide=    <2->{fill=tuelightblue},circle,text width=0.5cm,align=center,inner sep=1pt,minimum size=1.3cm]{\footnotesize text one};
                \end{tikzpicture}
                \begin{tikzpicture}
                    \node[onslide=<2>{fill=tuepurple},onslide=    <1>{fill=tuelightblue},onslide=<3>{fill=tuelightblue},circle,text width=0.5cm,align=center,inner sep=1pt,minimum size=1.3cm] {\footnotesize text two};
                \end{tikzpicture}       
                \begin{tikzpicture}
                    \node[onslide=<3>{fill=tuepurple},onslide=<-2>{fill=tuelightblue},circle,text width=0.5cm,align=center,inner sep=1pt,minimum size=1.3cm]{\footnotesize text three};
                \end{tikzpicture}  
            \end{center}  
        \end{column}
        \vrule{}
    \end{columns}
\end{frame}

\end{document}
2

You must log in to answer this question.

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