[Tex/LaTex] use subfigure in a multicol environment

multicolsubfigsubfloats

I want to add subfigures to get a 3 wide image as in the below image. When I attempt to use subfigure, it comes up with the error "Package multicol Warning: Floats and marginpars not allowed inside `multicols' environment!."

enter image description here

Here is my code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{subfigure}

\title{Condensed Product Safety Card}
\author{Jacob}
\date{February 2018}

\begin{document}

\section*{{\normalfont Condensed Product  Safety Card}}

\hrulefill

\begin{multicols}{2}

\section*{100P Screen Wash}
3.1C, 6.1E, 6.3B, 6.4A 6.8B, 6.9B, 9.1B

\begin{figure}
  \centering
  \mbox{
    \subfigure{\includegraphics[width = 0.3cm]{Images/Hazard_symbols/24_flammable.jpg}}\quad
    \subfigure{\includegraphics[width=0.3cm]{Images/Hazard_symbols/6_irritant.jpg}}\quad
    \subfigure{\includegraphics[width=0.3cm]{Images/Hazard_symbols/9_ecotoxic.jpg}}
  }
\end{figure}
\end{multicols}


\end{document}

Best Answer

Some comments and observations:

  • The subfigure package has been deprecated for a decade or more. Don't use it. Use subfig or subcaption instead.

  • There seems to be no need, though, for either the subfigure or the figure machinery: Your code doesn't feature any \caption directives, and the figures aren't supposed to "float" (in the LaTeX sense of the word).

  • If you embed the three \includegraphics statements in a center environment, everything seems to work out ok. I would use a relative width, such as 0.3\columnwidth, rather than an absolute width, such as 0.3cm. (Aside: Are the individual graphs really supposed to be just 3mm wide?)

  • A separate issue: You need \noindent before \hrulefill.

A full MWE (minimum working example):

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage[margin=1in]{geometry}
\usepackage[demo]{graphicx} % remove 'demo' option in real document

\begin{document}

\section*{\normalfont Condensed Product Safety Card}

\noindent \hrulefill

\begin{multicols*}{2}

\section*{100P Screen Wash}

3.1C, 6.1E, 6.3B, 6.4A 6.8B, 6.9B, 9.1B

\begin{center}
  \includegraphics[width=0.3\columnwidth]{Images/Hazard_symbols/24_flammable.jpg}\hfill
  \includegraphics[width=0.3\columnwidth]{Images/Hazard_symbols/6_irritant.jpg}\hfill
  \includegraphics[width=0.3\columnwidth]{Images/Hazard_symbols/9_ecotoxic.jpg}
\end{center}

\end{multicols*}

\end{document}