[Tex/LaTex] ! Undefined control sequence. minipage graphic

beamergraphics

I am trying to add two minipages beside each other in Latex beamer and I am getting the error ! Undefined control sequence.

I appreciate any help.

\documentclass[xcolor=dvipsnames]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{graphicx} %  30.05  13:01 adedd [demo]
\usepackage{wrapfig}
\usepackage{tikz}
\usetikzlibrary{shapes, arrows, shadows}
\usepackage{amsmath}
\usetheme{Antibes}
\newcommand{\twoobjects}[2]{%
  \centering \leavevmode\vbox{\hbox{#1}\nointerlineskip\hbox{#2}} %
}

\usecolortheme[named=Maroon]{structure}
\setbeamercovered{transparent}
\setbeamertemplate{footline}[page number]
\title{Test Test}
\author{Test Test}
\institute{Test Test}
\date{11.02.15}
\usepackage{float}
\begin{document}



\begin{frame}
\frametitle{Related Projects}

\begin{block}{Test Test}

Test Test Test Test

\begin{itemize}
\item Test, Test, Test,...
\end{itemize}

\end{block}


\begin{figure}[H]
\centering
\begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=.8\linewidth, height=360px]{img/moovit_2}
  \captionof{figure}{Moovit map modes}
  \label{fig:test1}
\end{minipage}%
\begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=.8\linewidth, height=360px]{img/moovit_4}
  \captionof{figure}{Moovit route monitoring}
  \label{fig:test2}
\end{minipage}
\end{figure}

\end{frame}


\end{document}

Best Answer

Command \captionof is provided by packages like capt-of, caption or any KOMA-class. It is useful if you want to give a caption in a non-floating environment, which can be useful at times.

Here, we have a beamer case. Floating is disabled in beamer, the user is solely responsible that suff is fitting on the frame. You are using package float along with the H placement specifier, which would again disable the floating.

You were using minipages to align the graphics, and give two separate captions. You don't need captionof though.

If you want to have a single caption for both figures, no problem as well :-)

\documentclass[xcolor=dvipsnames]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage{mwe}
\usepackage{capt-of}
\begin{document}



\begin{frame}
    \frametitle{Related Projects}
    \begin{figure}%[H]
        \centering
        \begin{minipage}{.5\textwidth}
            \centering
            \includegraphics[width=.8\linewidth, height=36px]{example-image}
            \caption{Moovit map modes}
            \label{fig:test1}
        \end{minipage}%
        \begin{minipage}{.5\textwidth}
            \centering
            \includegraphics[width=.8\linewidth, height=36px]{example-image}
            \captionof{figure}{Moovit route monitoring}
            \label{fig:test2}
        \end{minipage}
    \end{figure}

    \begin{figure}%[H]
        \centering
            \includegraphics[width=.4\linewidth,
            height=36px]{example-image}\hfill%
            \includegraphics[width=.4\linewidth, height=36px]{example-image}
            \caption{A caption for both images}
    \end{figure}

\end{frame}
\end{document}

eanUndefinedMinipage.

In general, a presentation is a visual/oral thing. Any text should aid the speaker. In my opinion, it is best just to say what is in the picture: «And here you can see the platypus doing the jazz dance«.