98

I need to insert 10 figures (in two columns- side by side) in LaTeX that will have one global caption, but also I need to name each figure (1a, 1b, 1c, ... ect.). So they will look like:

 1a        1b

 1c        1d

 1e        1f

 1g        1h

 1i        1j

Figure 1: plots of....

I would really appreciate if you guys can provide any help.

2 Answers 2

136

Below is how to insert two figures. Pls adapt this as per your needs. You need subcaption package.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=.8\linewidth]{image1}
  \caption{1a}
  \label{fig:sfig1}
\end{subfigure}%
\begin{subfigure}{.5\textwidth}
  \centering
  \includegraphics[width=.8\linewidth]{image2}
  \caption{1b}
  \label{fig:sfig2}
\end{subfigure}
\caption{plots of....}
\label{fig:fig}
\end{figure}
\end{document}

enter image description here

Refer this for information about another method http://texblog.org/2011/05/24/placing-figures-side-by-side-subfig/

This is also similar to what you are looking for - how to put subfigures in several rows

4
  • LaTeX Error: Environment subfigure undefined. What to do now? Commented Mar 1, 2014 at 16:58
  • @user1603548 You need the subcaption package. I modified the example to reflect this. Commented Mar 17, 2014 at 19:22
  • This answer does not explain how to change line and there are some subtleties, e.g., put % after \end{subfigure} etc.
    – Jimmy R.
    Commented May 3, 2020 at 15:34
  • For some reason inside an itemize which is inside a subsection this goes on a completely random page. Not where it is written in the tex file. :(
    – piepi
    Commented Aug 7, 2023 at 0:59
36

Instead of you using two environments-subfig and figure, you can just use figure and subfloat

\documentclass{article}
\usepackage{float}
\usepackage[caption = false]{subfig}
\usepackage[demo]{graphicx}
\begin{document}
\begin{figure}
\subfloat[fig 1]{\includegraphics[width = 3in]{something}} 
\subfloat[fig 2]{\includegraphics[width = 3in]{something}}\\
\subfloat[fig 3]{\includegraphics[width = 3in]{something}}
\subfloat[fig 4]{\includegraphics[width = 3in]{something}} 
\caption{Add your own figures before compiling}
\label{some example}
\end{figure}
\end{document}

After every two figures add \\ or adjust the width so that only two figures fit side by side.

==========================

Please change

\usepackage[demo]{graphicx} 

to

\usepackage[final]{graphicx}

to see your actual images (instead you will always see black boxes.

2
  • @texenthusiast I don't know how to create those fake black boxes so that is the best I could do.
    – dustin
    Commented Jun 19, 2013 at 4:46
  • 4
    \usepackage[demo]{graphicx} in preamble will do. Note figure-filenames don't need extensions something is fine depending on LaTeX engines executed it will detect which file extension is needed. Hope you might be aware of mwe package that specifically caters to MWE needs. Commented Jun 19, 2013 at 4:49

You must log in to answer this question.

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