## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ How to align two mini-page pictures?

Information and discussion about graphics, figures & tables in LaTeX documents.
lukaszskowron96
Posts: 31
Joined: Tue Oct 09, 2018 1:01 pm

### How to align two mini-page pictures?

Hi. My problem is very simple, as you can see on the picture below, the two pictures are not perfectly aligned i.e. right hand one is higher than left hand one. How can I align them?

\begin{figure}[H]\begin{minipage}[b]{0.5\linewidth}\centering\includegraphics[width=0.7\textwidth]{shapesrs1}\subcaption{Example foundation with $$R=\frac{1}{\pi} \approx 0.32$$}\end{minipage}\begin{minipage}[b]{0.5\linewidth}\centering\includegraphics[width=0.7\textwidth]{shapesrs2}\subcaption{$$\left. R_{RSmax}=\frac{B_{i}^2}{\pi r_{o}^2}\right\vert_{r_{o}=\frac{\sqrt{2}B_{i}}{2}}=\frac{2}{\pi}\approx0.64$$}\end{minipage}\caption{Ring foundations with central square perforation}\end{figure}

Thanks,

Lukasz

latexforumalingingpictures.png (66.54 KiB) Viewed 134 times

rais
Posts: 177
Joined: Sun Nov 16, 2014 8:51 pm
Have a look at the subcaption package.
Its \subcaptionbox commad may just be, what you're after.

KR
Rainer

lukaszskowron96
Posts: 31
Joined: Tue Oct 09, 2018 1:01 pm
I got an error:

! Missing $inserted. <inserted text>$
l.524 {\includegraphics{shapesrs2}}

?

after using this code:

\begin{figure}[H]\centering\subcaptionbox{Example foundation with $$R=\frac{1}{\pi} \approx 0.32$$}{\includegraphics{shapesrs1}}\subcaptionbox{\(\left. R_{RSmax}=\frac{B_{i}^2}{\pi r_{o}^2}\right\vert_{r_{o}=\frac{\sqrt{2}B_{i}}{2}}=\frac{2}{\pi}}{\includegraphics{shapesrs2}}\caption{Ring foundations with central square perforation}\end{figure}

Also had to change to \usepackage{caption} instead of \usepackage[center]{caption} and now captions are not centered for some figures.

lukaszskowron96
Posts: 31
Joined: Tue Oct 09, 2018 1:01 pm
I actually added some white space under the picture in the .png file and now they are aligned