# how to insert subfigures

I want to insert subfigures. I'm using this code

\documentclass[twocolumn]{mnl-author}
\usepackage{epstopdf}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfigure}
\usepackage{subcaption}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\begin{document}
\title{}
\author{}
\abstract{}
\maketitle
\section{Introduction}
\begin{figure}
\centering
\begin{subfigure}[b]{0.5\textwidth}
\includegraphics[width=\textwidth]{cap}
\caption{SwissRanger by MESA}
\label{fig:cap}
\end{subfigure}
\begin{subfigure}[b]{0.5\textwidth}
\centering
\includegraphics[width=\textwidth]{gmgds}
\caption{D-Imager by Panasonic}
\label{fig:gmgds}
\end{subfigure}
\caption{Caption}
\end{figure}
\end{document}


But there are many errors while compiling this that:

Use of @subfloat doesn't match its definition. \begin{subfigure}[b]{

Missing number, treated as zero. \begin{subfigure}[b]{width=0.3\textwidth}

Illegal unit of measure (pt inserted). \begin{subfigure}[b]{width=0.3\textwidth}

Use of @subfloat doesn't match its definition. \begin{subfigure}{

Missing number, treated as zero. \begin{subfigure}{0.3\textwidth}

Illegal unit of measure (pt inserted). \begin{subfigure}{0.3\textwidth}

Use of @subfloat doesn't match its definition. \begin{subfigure}{

Missing number, treated as zero. \begin{subfigure}{0.3\textwidth}

Illegal unit of measure (pt inserted). \begin{subfigure}{0.3\textwidth}

• I believe you have to \usepackage{subfigure} in the preamble for this to work... – Raven Dec 29 '18 at 15:27
• @Raven No, subcaption should be enough. But maybe it does not behave correctly with this class… – TeXnician Dec 29 '18 at 15:41
• Could you please try to use article class, add \begin{document} and \end{document} and use example-image.pdf for all your images? What happens? – TeXnician Dec 29 '18 at 15:42
• @Raven: No, subfigure is deprecated for almost 15 years ... the successor is subfig and as TeXnician wrote, subcaption would suffice – user31729 Dec 29 '18 at 16:17
• Definitely remove \usepackage{subfigure}. If I remove that line and change to article class (removing \address) and the example image your code works fine. – TeXnician Dec 29 '18 at 17:54