In the code, I want the captions of each image to start with (a), (b), etc. and I want to add borders. But it is coming as a separate figure number. I tried using subfigure, but then all the images in a single column.
First I tried-
\documentclass{article}
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{float}
\begin{document}
\begin{figure}[H]
\begin{multicols}{2}
\includegraphics[width=\linewidth]{countyeffect}
\caption{Random effect due to counties obtained from spline coefficients}
\label{fig7:a} \par
\includegraphics[width=\linewidth]{statemean}\caption{Mean value of states}
\label{fig7:b} \par
\end{multicols}
\begin{multicols}{2}
\includegraphics[width=\linewidth]{stateslope} \caption{Effect due to slopes}
\label{fig7:c} \par
\includegraphics[width=\linewidth]{overalllocation}\caption{Overall location effect due to variation in states and counties}
\label{fig7:d} \par
\end{multicols}
\caption{Illustration of different kind of location effects}
\end{figure}
\end{document}
source: Multiple figures in a two column latex file
I get the following image-
But when I try
\begin{figure}[H]
\begin{multicols}{2}
\begin{subfigure}{.5\textwidth}
\includegraphics[width=\linewidth]{countyeffect}
\caption{Random effect due to counties obtained from spline coefficients}
\label{fig7:a}
\includegraphics[width=\linewidth]{statemean}\caption{Mean value of states}
\label{fig7:b}
\end{subfigure}%
\end{multicols}
\begin{multicols}{2}
\begin{subfigure}{.5\textwidth}
\includegraphics[width=\linewidth]{stateslope} \caption{Effect due to slopes}
\label{fig7:c}
\includegraphics[width=\linewidth]{overalllocation}\caption{Overall location effect due to variation in states and counties}
\label{fig7:d}
\end{subfigure}%
\end{multicols}
\caption{Illustration of different kind of location effects}
\end{figure}
Then the subfigures are starting with (a), (b) etc. but I am getting a single column of all the images. But I want something like following-
Thanks.




subcaption, thesubfigurepackage doesn't define asubfigureenvironment, it defines a\subfiguremacro.subcaptionon the other hand, does define asubfigureenvironment with the same arguments as aminipage, as you can see in the OPs code. – Torbjørn T. Mar 06 '17 at 20:17