# Problem with the package exam

I have a problem with the package "exam". I want to put in the orizontal direction 4 images. And move every circle close to the middle of every image. I have post the picture. Thank you very much.

\begin{oneparcheckboxes}
\begin{figure}[!h]
\centering
\captionsetup{font={small,it}, labelfont=bf}
%\subfloat[][\emph{}] % didascalia sottofigura
\captionsetup{font={small,it}, labelfont=bf}
%\subfloat[][\emph{}] % didascalia sottofigura
% \subfloat[][\emph{}] % didascalia sottofigura
% \subfloat[][\emph{}] % didascalia sottofigura
{\choice\includegraphics[width=.2\textwidth]{grafico_9.pdf}} \\
\end{figure}
\end{oneparcheckboxes}


• Could you please make your example a complete document, so we can compile it directly? You are likely to get more help here if you do. – Thruston Jan 3 '16 at 23:06
• Why do you have a figure environment nested inside the oneparcheckboxes environment? – Thruston Jan 3 '16 at 23:06
• – Thruston Jan 3 '16 at 23:25
• This is not a problem with the exam class. It's a general problem of how to vertically centre a graphic. Basically get rid of the figure stuff and use \choice $\vcenter{\hbox{\includegraphics[width=0.2\textwidth]{grafico_9.pdf}}}$ for each item – Thruston Jan 3 '16 at 23:27

You want something more like this:

\documentclass{exam}
\usepackage{graphicx}
\begin{document}
\begin{oneparcheckboxes}
\choice $\vcenter{\hbox{\includegraphics[width=0.15\textwidth]{yourgraphicfile}}}$
\choice $\vcenter{\hbox{\includegraphics[width=0.15\textwidth]{yourgraphicfile}}}$
\choice $\vcenter{\hbox{\includegraphics[width=0.15\textwidth]{yourgraphicfile}}}$
\choice $\vcenter{\hbox{\includegraphics[width=0.15\textwidth]{yourgraphicfile}}}$
\end{oneparcheckboxes}
\end{document}


If you are doing this a lot, then you could hide the details by defining a new command:

\documentclass{exam}
\usepackage{graphicx}
\newcommand{\vpic}[1]{$\vcenter{\hbox{\includegraphics[width=0.15\textwidth]{#1}}}$}
\begin{document}
\begin{oneparcheckboxes}

• Also \raisebox{-.5\height}{\includegraphics[...]{...}}; the difference is negligible. Or \begin{tabular}{@{}c@{}}\includegraphics[...]{...}\end{tabular}. – egreg Jan 3 '16 at 23:45
• It has always surprised me that there is no [vcenter] option for the \includegraphics command. – Thruston Jan 3 '16 at 23:53
• @Thruston There is valign=m if you load adjustbox with the export option – egreg Jan 4 '16 at 0:02