0

I am trying to produce a slide in beamer as:

% !TeX TS-program = xelatex
\documentclass{beamer}

\usecolortheme[rgb={0.7,0.2,0.2}]{structure}
\beamertemplateshadingbackground{red!70}{yellow!85}

\mode<article>{
    \usepackage{fullpage}
  \usepackage[bookmarks=false]{hyperref}
}

\mode<presentation>{
    %\setbeamertemplate{background canvas}[vertical shading][bottom=red!10,top=blue!10]
    \usetheme{Darmstadt}
}

\newtheorem*{remark6}{\footnotesize Prediction, The Main Purpose of Spatial Analysis}

\title[\textcolor{yellow}{Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}]
{\Large  Analysis of Non-Gaussian Spatial Models with Covariates Measurement Error}
\date[{Ph.D. Thesis in Statistics} \hspace{5.3cm}December 4, 2018]{}%\\% \tiny November 2011

\begin{document}



\begin{frame}
\frametitle{\initfamily Prediction}
\begin{remark6}
\begin{columns}
\begin{column}{0.39\textwidth}
\vspace{-0.2cm}
\begin{alertblock}{}
            \begin{figure}
                    \center\vspace{-0.1cm}
                    \includegraphics<1>[width=\textwidth, height=0.75\textwidth]{F13.png}
                    \includegraphics<2>[width=\textwidth, height=0.75\textwidth]{F14copy.png}
                    \includegraphics<3>[width=\textwidth, height=0.75\textwidth]{F13.png}
                    \includegraphics<4>[width=\textwidth, height=0.75\textwidth]{F14copy.png}
            \end{figure}
\end{alertblock}
\end{column}
\begin{column}{0.49\textwidth}
\pause
\begin{block}{\center\scriptsize Bayesian Inference}
\center\scriptsize
Data Agumentation Method 
\end{block}
\pause
\begin{exampleblock}{\center\scriptsize Gibbs Sampling}
\center\scriptsize Metropolis - Hatings Algorithm
\end{exampleblock}
\pause
\begin{alertblock}{\center\scriptsize Bayesian Predictive Distribution}
\center\scriptsize Bayesian Spatial Prediction
\end{alertblock}
\end{column}
\end{columns}
\end{remark6}
\end{frame}
\end{document}

But the figure boxes are in different sizes as:

enter image description here

and

enter image description here

How can I fix it?

1
3

The main problem is that you have unprotected line endings after your images. To fix this you have to add a % after each of them (for more information, see What is the use of percent signs (%) at the end of lines? )


I suggest to use \centering instead of \center. In fact you anyway don't need it in the figure because

  1. figures are centred by default in beamer

  2. your image spans the complete textwidth, so centering makes no difference

One step further: you actually don't need the figure environment as you don't have a caption. This will save you from manually messing with the vertical spaces.


The definition of remark6 looks more than a bit fishy, why not simply using a block?


\documentclass{beamer}

\usecolortheme[rgb={0.7,0.2,0.2}]{structure}
\beamertemplateshadingbackground{red!70}{yellow!85}

\mode<presentation>{
    \usetheme{Darmstadt}
}

\begin{document}

\begin{frame}
    \frametitle{Prediction}
    \begin{block}{\footnotesize Prediction, The Main Purpose of Spatial Analysis}
        \begin{columns}[T]
            \begin{column}{0.39\textwidth}
                \begin{alertblock}{}
                    \includegraphics<1>[width=\textwidth, height=0.75\textwidth]{example-image}%
                    \includegraphics<2>[width=\textwidth, height=0.75\textwidth]{example-image}%
                    \includegraphics<3>[width=\textwidth, height=0.75\textwidth]{example-image}%
                    \includegraphics<4>[width=\textwidth, height=0.75\textwidth]{example-image}%
                \end{alertblock}
            \end{column}
            \begin{column}{0.45\textwidth}
                \pause
                \begin{block}{\centering\scriptsize Bayesian Inference}
                    \centering\scriptsize Data Agumentation Method 
                \end{block}
                \pause
                \begin{exampleblock}{\centering\scriptsize Gibbs Sampling}
                    \centering\scriptsize Metropolis - Hatings Algorithm
                \end{exampleblock}
                \pause
                \begin{alertblock}{\centering\scriptsize Bayesian Predictive Distribution}
                    \centering\scriptsize Bayesian Spatial Prediction
                \end{alertblock}
            \end{column}
        \end{columns}
    \end{block}
\end{frame}
\end{document}

enter image description here

3
  • @marmot I suggest to ask egreg, he is probably the president of the Society of unprotected line endings :) – samcarter_is_at_topanswers.xyz Nov 24 '18 at 20:15
  • @marmot \protect\marmot produces a happy looking marmot (as expected :) – samcarter_is_at_topanswers.xyz Nov 24 '18 at 20:19
  • Very good! ;-) ;-) – user121799 Nov 24 '18 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.