1

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 ?

3
  • tex.stackexchange.com/a/296625/134144 could be helpful.
    – leandriis
    Sep 6, 2020 at 14:19
  • There is also \raisebox{-\height}{...} to align tops. Sep 6, 2020 at 16:50
  • 1
    Your question's title is about how to "adjust the height", while the body is about alignment. You might want to improve the title (and maybe also the tags).
    – bers
    Feb 3, 2021 at 22:12

2 Answers 2

0

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

0

With inserting images in table and for caption use of \subcaption{<caption text>}. With valign=t defined in \adjustbox` is moved images baseline to their top:

\documentclass[11pt]{book}
\usepackage{geometry}
\usepackage[font=small, labelfont=bf,
            skip=0.5ex,belowskip=1ex
            ]{caption}
\usepackage{subcaption}
\usepackage[export]{adjustbox}

\begin{document}
    \begin{figure}[ht]
    \setkeys{Gin}{width=\linewidth}
    \centering
\begin{tabular}{p{0.45\linewidth} p{0.45\linewidth}}
    \includegraphics[valign=t]{example-image}
    &   \includegraphics[valign=t]{example-image-duck}  \\
\subcaption{}
\label{fig:my_fig_1}
    &   \subcaption{}
        \label{fig:my_fig_1}
\end{tabular}

\caption{My images}
\label{my_fig_all}
    \end{figure}
\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .