Text FormattingMinipage: align at 1st line of caption instead of last

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Minipage: align at 1st line of caption instead of last

Post by yiorgosb »

I have used this code to place two figures side by side.
However, the horizontal alignment is (by default I guess) at the last line of caption instead of the first. So if one caption has more lines the result is the other image to be moved upwards along with its caption, like:

*****img1*****...................
....................*****img2****
.................................
Fig1: foofoo foo.................
foofofofofo......................
foofofofofo.........Fig2:foofoo...

So the question is how to force the alignment at the caption first line, like:
*****img1*****......*****img2****
.................................
Fig1: foofoo foo....Fig2:foofoo..
foofofofofo......................
foofofofofo......................
Last edited by yiorgosb on Wed Mar 02, 2011 5:11 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Minipage: align at 1st line of caption instead of last

Post by gmedina »

Hi,

you could use this code instead:

Code: Select all

\begin{figure}[ht]
  \begin{minipage}[t]{0.45\linewidth}
    \centering
    \includegraphics{filename1}
    \caption{A test figure with a really long caption spanning several lines}
    \label{fig:figure1}
  \end{minipage}
  \hfill
  \begin{minipage}[t]{0.45\linewidth}
    \centering
    \includegraphics{filename2}
    \caption{A test figure}
    \label{fig:figure2}
  \end{minipage}
\end{figure}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
yiorgosb
Posts: 30
Joined: Mon Aug 02, 2010 11:56 pm

Minipage: align at 1st line of caption instead of last

Post by yiorgosb »

so the alignment top or bottom is controlled by
begin{minipage}[ b/t ]

Thanks problem solved
Post Reply