[Tex/LaTex] How to add a box of a fixed size (width and height) around a graphic of varying sizes

framedgraphics

I've found lots of references for ways to create a box around text, but none for around graphics. I want the border frame around the graphic to all be the same size, with a graphic inside the box, centered vertically and horizontally, and a caption outside the box. This box would need to be able to be placed side by side so it effectively makes a grid.

EDIT: Here is a working demo

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage[letterpaper, margin=1in]{geometry}

\begin{document}
\setlength\unitlength{1in}


\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{infinity_80_gf_2010}}
\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{Plus80_2010}}
\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{comfort_achp_Puron}}


\bigskip

\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{Pref_Vent_VA}}
\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{infinity_98}}
\framebox(2,2){\includegraphics[width=1.875in,height=1.875in,keepaspectratio]{infinity_80_gf_2010}}

\end{document}

This is the result:

result

Best Answer

Anything you have read about boxing text applies to boxing images. The box commands do not care about what is in their content.

Here are two boxes which are the same size each containing an image horizontally and vertically centred:

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx}

\begin{document}
\setlength\unitlength{1cm}


\framebox(4,2){\includegraphics[width=2cm,height=1cm]{aa}}


\bigskip

\framebox(4,2){\includegraphics[width=1cm,height=1.5cm]{aa}}

\end{document}