1

I wish to add to subfigures side by side and have the following code

 \begin{figure}
\centering
\begin{subfigure}
\centering
\includegraphics[width=0.25\columnwidth]{figures/figure1}%
\caption{bla1}
\label{fig:CL1}
\end{subfigure}%
\begin{subfigure}
\centering
\includegraphics[width=0.25\columnwidth]{figures/figure2}%
\caption{bla2}
\label{fig:CL2}
\end{subfigure}
\caption{bla bla bla}%
\label{fig:CL}
\end{figure}

I've also tried removing the "%" sign after subfigure 1, but makes no difference. I'm using the package "subfigure", so I'm not sure what I am missing to get it to work, any help would be appreciated.

1

1 Answer 1

2

The package subfigure is obsolete. You should use subcaption or subfig packages for this facility. Here is your case with subcaption.

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
   \begin{figure}
\centering
\begin{subfigure}{0.5\columnwidth}
\centering
\includegraphics[width=0.9\linewidth]{example-image}
\caption{bla1}
\label{fig:CL1}
\end{subfigure}%
\begin{subfigure}{0.5\columnwidth}
\centering
\includegraphics[width=0.9\linewidth]{example-image-a}
\caption{bla2}
\label{fig:CL2}
\end{subfigure}
\caption{bla bla bla}
\label{fig:CL}
\end{figure}
\end{document}

enter image description here

3
  • It doesn't seem like subcaption helps. I've tried adding the packages, but end up getting the errors. It doesn't seem like it knows when the subfigures end.
    – JonasN89
    Sep 21, 2015 at 12:11
  • @JonasN89 Please update your tex distribution
    – user11232
    Sep 21, 2015 at 12:28
  • I'm using texnicCenter, I don't know if that has anything to do with it? My tex distribution, what is that?
    – JonasN89
    Sep 21, 2015 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .