I try to make a frame in which I indicate a figure on the right side and add a description about it on the left side. I want the description top-aligned and the figure center-aligned, but I have difficulty in outputting like this. Here is what I first tried:
\documentclass[10pt,aspectratio=1610,t]{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}\frametitle{Minimum Working Exaple}
\begin{columns}[t,onlytextwidth]
\begin{column}{.5\textwidth}
This is the first column.
\end{column}
\begin{column}{.5\textwidth}
\begin{figure}[h]
\centering
\parbox[c][\textheight][c]{\columnwidth}{
\begin{tikzpicture}
\useasboundingbox (0, 0) rectangle (5, 5); % assign a bounding box
\fill (current bounding box.south west) rectangle (current bounding box.north east); % fill the current bounding box
\end{tikzpicture}
\caption{Enter the caption here}
}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\end{document}
With the code avobe, I get
To place the figure where I want it to be, I googled for solution and found this answer. I tried changing the second parameter of \parbox
to .7\textheight
. Then, I get
This time the figure goes upward (although I do not know whether it is EXACTLY vertically centered). However, the figure remains to be horizontally centered in the right column in spite of \centering
.
How can I center the figure both vertically and horizontally?
Update
Gonzalo Medina suggested me using minipage
environment instead of columns
environment and this substitution output the desired result. However, I still do not know why \centering
in my code (i.e. in column(s)
environment) does not work well. I would highly appreciate it if anyone taught me the reason.
\centering
issue.