1

I know there are a ton of questions about this but I seem to not be able to find want I want. I want to pictures side by side with the picture aligned to the top and the caption to the bottom. I wanted to follow this answer, but the minipage position parameter doesn't seem to work.

MWE:

    \begin{figure}[htbp]
    \centering
    \begin{minipage}[b]{0.6\textwidth}
    \includegraphics[width=\textwidth]{example-image-a.pdf}
    \end{minipage}%%%
    \hfill
    \begin{minipage}[b]{0.35\textwidth}
    \includegraphics[width=\textwidth]{example-image-a.pdf}
    \end{minipage}
\begin{minipage}[t]{0.6\textwidth}
\caption{Caption 1.}
\label{fig1}
\end{minipage}%%%
\hfill
\begin{minipage}[t]{0.35\textwidth}
\caption{Caption 2.}
\label{fig2}
\end{minipage}
\end{figure}

This gives me: enter image description here

independent of whether I have a b's or t's in the first two minipages.

Want I would want is: enter image description here

No matter what I do the second image doesn't want to move up. I have tried adding a vertical space after the second image and that does work but then I have to guess the distance...

Simon Dispa
  • 39,141
C. Binair
  • 111
  • 2

1 Answers1

1

Using the package adjustbox is a possibility. See https://tex.stackexchange.com/a/34200/161015 and the nice explanation https://tex.stackexchange.com/a/34172/161015

a

\documentclass[12pt,a4paper]{article}

\usepackage{graphicx} \usepackage{adjustbox} % added <<<<<

\begin{document}

\begin{figure}[htbp]
\centering
\adjustbox{valign=t}{\begin{minipage}{0.6\textwidth} % changed &lt;&lt;&lt;&lt;
    \includegraphics[width=\textwidth]{example-image-a.pdf}
\end{minipage}}%%%
\hfill  

\adjustbox{valign=t}{\begin{minipage}{0.35\textwidth}% changed <<<< \includegraphics[width=\textwidth]{example-image-a.pdf} \vfill \end{minipage}} \begin{minipage}[t]{0.6\textwidth} \caption{Caption 1.} \label{fig1} \end{minipage}%%% \hfill \begin{minipage}[t]{0.35\textwidth} \caption{Caption 2.} \label{fig2} \end{minipage} \end{figure}

\end{document

Simon Dispa
  • 39,141
  • If you load the adjustbox package with the export option, you can add valign=t as an option to \includegraphics in order to get the same output. – leandriis Jun 07 '21 at 17:33