I'm trying to use LaTeX to create a photo directory. On a given page, I want it to have a grid of photos (which are of varying aspect ratios) with the information for that person above/below the photo enclosed in a box. I've played around with using figures, but I can't seem to get the sizing to be consistent enough to make it look like a nice grid.
Here's an example of what one of the figures looks like:
\begin{figure} \centering
\framebox[3.5in]{\LARGE Name}\\
\includegraphics[width=3.5in,height=2.345in]{image.jpg}\\
\fbox{\parbox{3.5in}{\centering Address\\
Home: PhoneNumber\\
Person1: PhoneNumber\\
Person2: PhoneNumber
}}
\end{figure}
The problem is that some of the frameboxes will be different heights because of names with letters like g and y, and then the different aspect ratios of the photos make the total size of the boxes vary.
Is there a better way to layout a grid of photos and text so the dimensions will be consistent regardless of the text in the name or the aspect ratio of the photo?
UPDATE: Combining the comments by uwe-ziegenhagen and and mike-renfro, I switched to a tabular and it seems to be working better. Also based on egreg's suggestion, I also now only specify the width or height (whichever will fill the dimension of the desired aspect ratio).
But still the row with the image in the tabular is of varying height based on the image. The "Rules and Struts" section of (http://en.wikibooks.org/wiki/LaTeX/Advanced_Topics) indicates that \rule
could be used, but it leaves a large gap and then the image.
This answer said that creating a \vrule
would allow for specifying the height of the row and it does, but then the image is at the bottom of the row. Is there a way to fix that?
Here's an example and I need a way to make both of the images be in the center of the tabulars that are the same height even though one has a smaller image (\rule in this example):
\newcolumntype{C}{>{\centering\arraybackslash} m{3.5in} }
\\def\\photostrut{\\vrule height 3.5in depth 0in width 0in}
\begin{tabular}{|C|} \hline
\LARGE Name \strut \\ \hline
\photostrut \rule{2.5in}{3.25in} \\ \hline
Address \strut \\
Home: PhoneNumber \strut \\
Person1: PhoneNumber \strut \\
Person2: PhoneNumber \strut \\ \hline
\end{tabular}
\begin{tabular}{|C|} \hline
\LARGE Name \strut \\ \hline
\photostrut \rule{3.5in}{2.0in} \\ \hline
Address \strut \\
Home: PhoneNumber \strut \\
Person1: PhoneNumber \strut \\
Person2: PhoneNumber \strut \\ \hline
\end{tabular}
\strut
here and there (for instance, at the beginning and at the end, if the text spans more than one line). (\strut
s are invisible, zero-width objects with height and depth of a "maximal" text line.) – mbork Mar 31 '12 at 10:11