TransWikia.com

How to adjust the height of subfigures of different sizes?

TeX - LaTeX Asked by Javaccess on September 27, 2020

I have the following piece of code

begin{figure*}
centering
subfloat[][]{includegraphics[scale=0.9]{A_big_figure}
label{fig:my_fig_1}}
subfloat[][]{includegraphics[scale=0.9]{A_small_figure} 
label{fig:my_fig_2} } 
label{my_fig_all}
end{figure*}

with the second graphic being much smaller than the first one, but of the same width (i.e. just scaling it won’t be useful for me). Currently, Latex aligns me the bottom of both figures i.e. there is a blank above the second figure. However, I would like the contrary, that is having the top of both figures aligned with a blank space below the small one. I tried byadding some negative white space before the second figure but this does not work.

Do you have any ideas ?

One Answer

You can do that with the floatrow package and its subfloatrow environment:

documentclass[11pt]{book}
usepackage{geometry}
usepackage{floatrow, subcaption, graphicx}

begin{document}

begin{figure*}[!ht]
floatsetup{style=plain, floatrowsep=qquad, heightadjust=object, valign=t, captionskip=3ex}
ffigbox[FBwidth]
{begin{subfloatrow}
ffigbox[FBwidth]{caption{Traccia Table}label{flt1}}
{includegraphics[scale=0.3]{traccia-table}}
ffigbox[FBwidth]{caption{Fur breakfast}label{flt2}}
{includegraphics[scale=0.8]{dejeuner1}}
end{subfloatrow}}{caption{Meret Oppenheim}label{Meret}}
end{figure*}

end{document} 

enter image description here

Answered by Bernard on September 27, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP