I tried to insert side by side figures making a minipage instead of subfigures. The captions of the two figures are not aligned and are numbered ina wrong way.
I'd like to align captions and number the figures (a), (b) and the total figure fig. n with n the correct number (1 if the fig is the first in the document ecc).
\documentclass{article}
\usepackage{mwe}
\begin{document}
\begin{figure}[h]
\centering
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[scale=0.3]{fig2a}
\caption{Modello compartimentale mammellare (o mammillare).}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
\centering
\includegraphics[scale=0.3]{fig2b}
\caption{Modello compartimentale catenario.}
\end{minipage}
\caption{Principali topologie dei modelli compartimentali.}
\end{figure}
\end{document}
Thank you very much in advance.
Best Answer
To repeat what was already stated in the comments: A
subfigure
environment is already aminipage
environment -- just one with some added capabilities related to creating captions.Here's how I'd rewrite your code, mainly loading the
subcaption
package and using twosubfigure
environments.