Two figures side by side
You can put minipage
s 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}
I was surprised to discover two \captions
in the same figure
environment actually work as desired.
HT: LaTeX Matters via Google
Since your figures shall be side by side, they are not expected to float independently. So you need just one figure environment for both objects.
Within this figure environment, you may use minipages (like Matthew already suggested). Some additions:
- minipages understand optional alignment parameters to align at top, bottom or center.
- For adding a caption to the minipages, I recommend to use the subcaption package. It is part of the feature-rich caption package.
Nevertheless you could check out the subfig package. That task could be handled like subfigures even if you customize the captions such that they look like two independent figures.
The floatrow
package can easily do that (and many other things) with its floatrow environment:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{floatrow}%
\begin{document}
\begin{figure}[!h]
\begin{floatrow}
\ffigbox{\includegraphics[scale = 0.8]{casxinf1}}{\caption{Case $ x < 1 $}\label{case1}}
\ffigbox{\includegraphics[scale = 0.8]{zoom}}{\caption{A zoom}\label{zoom}}
\end{floatrow}
\end{figure}
\end{document}