I would like to place 4 images next to each other, with a single caption underneath. Normally, I would use the following for this:
\begin{figure}[htb]
\centering
\subfloat{\includegraphics[width=0.25\linewidth]{fig1.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig2.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig3.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig4.pdf}}\hfill
\caption{Single caption underneath all 4 images!}
\label{fig:four-figs}
\end{figure}
However, since I am in a multicols
environment, I get the following error:
Package multicol Warning: Floats and marginpars not allowed inside `multicols' environment!.
How can I achieve the same effect of the subfloat
, but within the multicols
environment?
Here is my MWE:
\documentclass[a0,portrait]{a0poster}
\usepackage{multicol}
\columnsep=100pt
\columnseprule=3pt
\usepackage[svgnames]{xcolor}
\usepackage{palatino}
\usepackage{graphicx}
\usepackage[font=small,labelfont=bf]{caption}
\usepackage{amsfonts, amsmath, amsthm, amssymb}
\usepackage{wrapfig}
\usepackage[caption=false]{subfig}
\captionsetup[figure]{labelfont={color=NavyBlue}}
\begin{document}
\begin{multicols}{2}
\begin{figure}[htb]
\centering
\subfloat{\includegraphics[width=0.25\linewidth]{fig1.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig2.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig3.pdf}}\hfill
\subfloat{\includegraphics[width=0.25\linewidth]{fig4.pdf}}\hfill
\caption{Single caption underneath all 4 images!}
\label{fig:four-figs}
\end{figure}
\end{multicols}
\end{document}
[width=0.25\columnwidth]
?figure
environment is simply not showing on the output.\captionof{figure}{Single caption underneath all 4 images!}
.