0

The images do not share a horizontal bottom line, and neither do the captions when using:

\centering
\begin{minipage}{.48\textwidth}
  \centering
  \includegraphics[width=\linewidth]{Figures/im1}
  \captionof{figure}{Long caption ..........................................................................................................................}
  \label{fig:im1}
\end{minipage}
\hfill
\begin{minipage}{.48\textwidth}
  \centering
  \includegraphics[width=\linewidth]{Figures/im2}
  \captionof{figure}{Long caption ...........................................................................................................................}
  \label{fig:im2}
\end{minipage}
\end{figure}

Is there a way I can make the base of the image, and the top of the captions aligned horizontally?

New contributor
hun is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • use a tabular with p-columns instead of two minipages. – Ulrike Fischer yesterday
  • It could be done with the floatrow package. – Bernard yesterday
  • @hun welcome to the site -- please have a look athe answer below – js bibra yesterday
1

Quite simple with the floatrow package:

\documentclass{article}
\usepackage[margin=2cm]{geometry}
\usepackage{erewhon}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{floatrow}

\begin{document}

\begin{figure}
\centering
\begin{floatrow}
\ffigbox[\FBwidth]{\caption{Meret Oppenheim – Schoolgirl’s Notebook}}{ \includegraphics[width=\linewidth]{cahier}}
\hfill
\ffigbox[\FBwidth]{\caption{Meret Oppenheim – My Nurse}}{\includegraphics[width=0.8\linewidth]{magouvernante}}
\end{floatrow}
\end{figure}

\end{document} 

enter image description here

1

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\begin{document}

\begin{figure}
\centering
\begin{minipage}[b]{.48\textwidth}
  \includegraphics[width=\linewidth]{example-image}
\end{minipage}
\hfill
\begin{minipage}[b]{.48\textwidth}
  \includegraphics[width=\linewidth]{example-image-16x9}
\end{minipage}
\begin{minipage}[t]{.48\textwidth}
  \caption{Long caption long caption long caption long caption long caption long caption long caption long caption long caption long caption \label{fig:im1}}
\end{minipage}
\hfill
\begin{minipage}[t]{.48\textwidth}
  \caption{Long caption long caption long caption long caption long caption long caption \label{fig:im2}}
\end{minipage}
\end{figure}

\end{document}
  • Uhm, the \includegraphics inserts images on the baseline, so wrapping those into a minipage with [b] is rather superfluous. But +1 anyway ;-) – campa yesterday
1

two methods -- measure the width of the figure and save it in a sbox --or align the minipages at the bottom by using the [b] option -- result for both is the same

with the savebox option

enter image description here

or with minipages bottom aligned and captionsetup = linewidth

enter image description here

MWE

\documentclass[10pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{blindtext}

\begin{document}
    \begin{figure}[!ht]
    \begin{minipage}[b]{.48\textwidth}
        \centering
        \sbox0{\includegraphics[width=\linewidth]{example-image}}% measure width}
        \begin{minipage}{\wd0}
            \usebox0
            \caption{\blindtext}
        \end{minipage}
        \label{fig:im1}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{.48\textwidth}
        \centering
        \sbox0{\includegraphics[width=\linewidth]{example-image-16x9}}
        \begin{minipage}{\wd0}
            \usebox0
            \caption{\blindtext}
        \end{minipage}
        \label{fig:im2}
    \end{minipage}
\end{figure}

    \begin{figure}[!ht]
    \begin{minipage}[b]{.48\textwidth}
        \centering
                \captionsetup{width=\linewidth}
        \includegraphics[width=\linewidth]{example-image}
                    \caption{\blindtext}
            \label{fig:im1}
    \end{minipage}
    \hfill
    \begin{minipage}[b]{.48\textwidth}
        \centering
                        \captionsetup{width=\linewidth}
        \includegraphics[width=\linewidth]{example-image-16x9}
                    \caption{\blindtext}
            \label{fig:im2}
    \end{minipage}
\end{figure}
\end{document}
  • added above please – js bibra yesterday
  • offending portion removed now – js bibra yesterday

Your Answer

hun is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.