I'm using the tabular environment to place 2 figures side by side on beamer. When images are "small enough" everything is good, but if I ask for images to be a little larger (using \textwidth
) the result is that they are not centered horizontally anymore. Here's an example of both not centered and centered:
\documentclass{beamer}
\usepackage[spanish,es-nodecimaldot,es-tabla]{babel}
\usepackage[T1]{fontenc}
\usepackage{tikz,graphicx,multirow,amsmath,amsfonts}
\usepackage{lmodern}
\usetheme{Goettingen}
\begin{document}
\section{First section}
\begin{frame}{Figures are not centered on the sides}{Looks bad :(}
\begin{tabular}{cc}
Some figure 1 & Some figure 2\\
\includegraphics[width=0.49\textwidth]{example-image} & \includegraphics[width=0.49\textwidth]{example-image}
\end{tabular}
\end{frame}
\begin{frame}{These are centered!}
\begin{tabular}{cc}
Some figure 1 & Some figure 2\\
\includegraphics[width=0.45\textwidth]{example-image} & \includegraphics[width=0.45\textwidth]{example-image}
\end{tabular}
\end{frame}
\end{document}
And it produces:
I don't know if it's because I'm using \textwidth
. Maybe I should use something else instead? But I don't know what. Using scale does the same thing.
Any advice is greatly appreciated!
\textwidth
it will break out, nevertheless.\centering
before the tabular environment and it doesn't change anything. Using\begin{center} ... \end{center}
around tabular changes vertical alignment, but not horizontal. Any other ideas?