[Tex/LaTex] Figure caption appears on the side instead below

captionsminipage

I am using beamer class to make a presentaation. I am using minipage to get 4 figures in 2 by 2 arrangement.

When I give captions to the figures 2 problems arise:

  • The caption starts right from the figure instead of below
  • Instead of decreasing the size of the figure the caption will be cut by the figure.
  • I also get error: "\caption outside figure or table. \end{frame}"
\documentclass{beamer}
\usetheme{default}
\setbeamerfont{caption}{size=\footnotesize}
\begin{document}
  \begin{frame}
      \begin{columns}
          \column{0.5\textwidth}
          \begin{minipage}[c][0.4\textheight][c]{\linewidth}
              \centering
              \includegraphics[width=1\linewidth]{ETRM1042-epspdf-to}
              \caption{WT terminal voltage}
          \end{minipage}
          \begin{minipage}[c][0.4\textheight][c]{\linewidth}
              \centering
              \includegraphics[width=1\linewidth]{ITRM1042-epspdf-to}
              \caption{WT terminal current}
          \end{minipage}
          \column{0.5\textwidth}
          \begin{minipage}[c][0.4\textheight][c]{\linewidth}
                      \centering
                      \includegraphics[width=1\linewidth]{ETRM1042-epspdf-to}
                  \caption{Caption 3}
                  \end{minipage}
          \begin{minipage}[c][0.4\textheight][c]{\linewidth}
              \centering
              \includegraphics[width=1\linewidth]{VAACC-epspdf-to}
              \caption{previous Vterm angle}
          \end{minipage}
      \end{columns}
    \end{frame}
   \end{document}

enter image description here

Best Answer

Less complication you will have with the following approach:

\documentclass{beamer}
    \usepackage{graphicx}
    \usepackage{tabularx}

\begin{document}
\begin{figure}
\begin{frame}
    \begin{tabularx}{\textwidth}{*{2}{>{\centering\arraybackslash}X}}
\includegraphics[width=0.9\linewidth,height=24mm]{example-image-a}
\caption{WT terminal voltage}
    &   \includegraphics[width=\linewidth,height=24mm]{example-image-a}
        \caption{???}
        \\  % new row
\includegraphics[width=0.9\linewidth,height=24mm]{example-image-b}
\caption{WT terminal current}
    &   \includegraphics[width=\linewidth,height=24mm]{example-image-b}
        \caption{previous Vterm angle}
    \end{tabularx}
\end{figure}
\end{frame}
\end{document}

enter image description here

Of course, to see captions, your images show appropriate limit their heights.

Edit: To have numbered captions, you need to add in preamble \setbeamertemplate{caption}[numbered].

Addendum: As asked in comment, the "captions" without word "Figure" is easy to obtain -- just not use \caption{...} :-). Possible solution is demonstrated in MWE below.

\documentclass{beamer}
    \usetheme{default}
%----
    \usepackage{graphicx}
    \usepackage{tabularx}

\begin{document}
\begin{frame}
    \begin{tabularx}{\textwidth}{*{2}{>{\centering\arraybackslash}X}}
\includegraphics[width=0.9\linewidth,height=24mm]{example-image-a}\newline\footnotesize
WT terminal voltage
    &   \includegraphics[width=\linewidth,height=24mm]{example-image-a}\newline\footnotesize
        ???
        \\[1em]  % new row
\includegraphics[width=0.9\linewidth,height=24mm]{example-image-b}\newline\footnotesize
WT terminal current
    &   \includegraphics[width=\linewidth,height=24mm]{example-image-b}\newline\footnotesize
        previous Vterm angle
    \end{tabularx}
\end{frame}
\end{document}

which gives:

enter image description here