66

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.

migrated from stackoverflow.com Jun 19 '13 at 4:22

This question came from our site for professional and enthusiast programmers.

86

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

  • LaTeX Error: Environment subfigure undefined. What to do now? – user1603548 Mar 1 '14 at 16:58
  • @user1603548 You need the subcaption package. I modified the example to reflect this. – Torbjørn T. Mar 17 '14 at 19:22
24

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 ever two figures add \\ or you can adjust the width so that only two figures will 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.

  • @texenthusiast I don't know how to create those fake black boxes so that is the best I could do. – dustin Jun 19 '13 at 4:46
  • 2
    \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. – texenthusiast Jun 19 '13 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.