[Tex/LaTex] Two figures side by side

captionsfloatssubfloats

How can I put two figures side-by-side? Not two sub-figures, but two actual figures with separate "Fig.: bla bla" captions. A figure is supposed to spread over the entire text width, but I have two figures which are narrow and long, and I need to save the space in order to withstand the pages limit.

Best Answer

You can put minipages inside a figure environment and get separate captions for each of them.

\documentclass{article}
\usepackage{lipsum}
\usepackage{mwe}

\begin{document}
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.

\lipsum

\begin{figure}
    \centering
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=0.9\textwidth]{example-image-a} % first figure itself
        \caption{first figure}
    \end{minipage}\hfill
    \begin{minipage}{0.45\textwidth}
        \centering
        \includegraphics[width=0.9\textwidth]{example-image-b} % second figure itself
        \caption{second figure}
    \end{minipage}
\end{figure}

\lipsum[3]

\end{document}

sample code rendering

I was surprised to discover two \captions in the same figure environment actually work as desired.

HT: LaTeX Matters via Google