[Tex/LaTex] How to put 12 figures in 3 columns

floats

Here is my effort: I want to put 12 figures in three columns and four rows. Can anyone demonstrate that how should do this correctly? Following gives 1 column with 4 figures. Need to generate another two columns.

\begin{figure} 
\minipage{0.50\textwidth}
\includegraphics[width=\textwidth]{20} 
\includegraphics[width=\textwidth]{30}
\includegraphics[width=\textwidth]{37}
\includegraphics[width=\textwidth]{40}
\endminipage\hfill
\end{figure}

After reading comments this got following

\begin{figure} 
\centering
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%
\includegraphics[width=.25\textwidth]{m4crack30}\hfill%

\end{figure}

issue is to not getting in full size by removing minipage!

The question is still on pending! No helpful answer yet.

Best Answer

The OP requests an example, so here is one. I set each figure to .32\textwidth, so that 3 of them not quite fill up a line. I place \hfill between them to give even separation. I use \\ between lines.

All of this is within a minipage of .5\textwidth, though that doesn't necessarily make sense by itself inside a figure environment, unless you were going to add a second minipage to the same figure, so I added one as an example.

\documentclass[a4paper]{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure} 
\begin{minipage}{0.5\textwidth}
\includegraphics[width=.32\textwidth,height=1cm]{30}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{40}\\
\includegraphics[width=.32\textwidth,height=1cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{40}\\
\includegraphics[width=.32\textwidth,height=1cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{40}\\
\includegraphics[width=.32\textwidth,height=1cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=1cm]{40}
\end{minipage}%
\fboxsep=-\fboxrule%
\fbox{\begin{minipage}{0.5\textwidth}
Here is a 2nd minipage in the same figure.
\end{minipage}}
\end{figure}
\end{document}

enter image description here

As Torbjorn suggests, if you want a full-width figure array, get rid of the minipage.

\documentclass[a4paper]{article}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\centering
\includegraphics[width=.32\textwidth,height=2cm]{30}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{40}\\
\includegraphics[width=.32\textwidth,height=2cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{40}\\
\includegraphics[width=.32\textwidth,height=2cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{40}\\
\includegraphics[width=.32\textwidth,height=2cm]{20}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{37}\hfill%
\includegraphics[width=.32\textwidth,height=2cm]{40}
\end{figure}
\end{document}

enter image description here