In LaTeX I'm trying to put two figures next to each other, with captions below, where the captions might have unequal numbers of lines in them. The images are bottom-aligned, and the captions are top-aligned.
Figures 8, 9, 10, 11 in the floatrow
documentation (p 20) illustrate what I'm hoping to do (using four figures), but the author gives only a partial example, which I cannot get to work:
Can anyone provide a minimum working example that produces Figures 8, 9, 10, 11 as shown in the document. For the filenames of the image files, you can use graphics/fig8.png
, graphics/fig9.png
, etc. And if it could be the complete LaTeX file, that would be preferable, so I could see the preamble, too.
One last thing: I'm using the style tufte-book
— I think it sometimes has conflicts with other packages, but I'll figure that out later. 🙂
Best Answer
You can grab the
floatrow
documentation code:where the pictures are contained within
pictures.tex
.Either way, a package-less approach would be to set each inside a
tabular
:Each image + caption falls within a fixed-width
p
-column, with each image set to the width of that column. It's similar to setting the image in the key-value settings for\includegraphics
.This works because images are naturally set on the baseline and take up exactly one line. Moreover, each cell within the
tabular
is set using ap
-column, which has its alignment anchor set to be the baseline of the top line. As a result, the images are bottom-aligned, while the captions are top-aligned.You can adjust the spacing between the figures and the captions as needed. The same goes for the gap between the images, which default to
\tabcolsep
in the above example. One could also usetabularx
for spreading content out and/or making it stretch-and-fit within the text block.