Questions tagged [subcaption]

{subcaption} is a package for typesetting captions of {subfloats}.

is a package for typesetting captions of .

Here's an example demonstrating the basic use of .

\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}

\begin{document} 
\begin{figure}
    \centering
        \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{img1}
        \caption{First image}
    \end{subfigure}
\qquad
    \begin{subfigure}[b]{0.4\textwidth}
        \includegraphics[width=\textwidth]{img2}
        \caption{Second Image}
        \label{second}
    \end{subfigure}
    \caption{Some test images}
\end{figure}
\end{document}

Frequently Asked Questions

  1. What are some differences between the subfig and subcaption packages?
  2. Compatibility issue between subcaption and the CIFA document class
  3. How can I get subcaption to work with a multi-page figure?
  4. How can I reference subfigures in the main caption?
993 questions
38
votes
3 answers

Vertical Spacing using \subcaption package

I have a simple problem. I'm trying to add a little bit of vertical spacing between the top two and bottom two subfigures. Here's my…
Tim
  • 483
15
votes
1 answer

Command \c@subfigure already defined

when I try \usepackage{subcaption} immediately at the beginning of my document I get an error: Command \c@subfigure already defined What can I do?
mljrg
  • 1,159
11
votes
1 answer

Changing the formatting of subcaption for reference

\usepackage{subcaption} \begin{figure}[t] \begin{subfigure}{1\linewidth} Figure1 \caption{Hello}~\label{fig:TBS} \end{subfigure} \begin{subfigure}{1\linewidth} Figure2 \caption{Hello1} …
william007
  • 4,781
7
votes
4 answers

Equal horizontal spaces between subfigures of different sizes

How can I shift the subfigure (j) to the left such that the horizontal space x between subfigure (i) and (j) is equal to all subfigures like in the first or second row. My…
4
votes
2 answers

Latex counts a figure as two if it includes subfigures and the caption is above the figure

I have a strange bug where Latex does not continuously count figures. This bug appears only if the caption is above the figure and if the figure includes subfigures. The number of subfigures does not matter, as long as it includes at least one, it…
Jakob
  • 204
4
votes
1 answer

How to put a matrix of images in bulk?

It's not difficult to put a matrix of images. For example, in such a derectory . ├── document.tex ├── pictures │   ├── CellA │   │   ├── p1.JPG │   │   ├── p2.JPG │   │   ├── p3.JPG │   │   └── p4.JPG │   ├── CellB │   │   ├── p1.JPG │   │   ├──…
4
votes
4 answers

Subcaption: horizontal alignment of images

I currently want to depicting how an algorithm is working. The algorithm is using three different steps, which are repeatedly called. So I want a result like this: But I currently only get My…
SunBlack
  • 337
3
votes
1 answer

Adding in captions for subfigures leads to completely separate figures rather than labels like (a) or (b)

I have a figure in my LaTeX file with two subfigures. I want to add a label to each subfigure like (a) and (b) while maintaining an overall description of the figure below. The code that I have is like…
Sean
  • 221
3
votes
1 answer

How to change subcaption numbering?

I'm currently using this…
EoDmnFOr3q
  • 2,299
3
votes
1 answer

Subcaption in a tabular

I have a tabular with 4 sub-figures and I want to set the caption for each figure respectively. I'm using the subcaption package but I'm getting the following error on compilation: package floatrow error: caption(s) lost. Can anyone tell where the…
3
votes
1 answer

Is the subcaption package incompatible with aaai.sty?

A number of packages including caption are included in the AAAI formatting requirements as incompatible, and the list is said to be not exhaustive. Is the subcaption package permitted? I am particularly interested on preparing my submission to…
3
votes
2 answers

How can I write a "subcaption" on top of figure using subfigure package. But only in selected subfigure

I'm trying to change bubcaption to the top but can't find a way using subfigure package. Can not add captio/ subcaption package because they crash with subfigure package, and I'm already half way through a very long document. That's what I type: …
3
votes
1 answer

subcaption: third figure breaks column

I would like to align one big image next to three different small ones with the help of the subcaption (wich is used in all the rest of my document). But I still don't get the posistions "right". The one-nextTo-two version looks okay (despite an…
Guntram
  • 105
2
votes
2 answers

Adding a dashed vertical line between subfigures and their subcaptions

Similar to this: How to set color dashed vertical rule between images I want to place a dashed line between two subfigures. I have been able to get it working with a \vrule, but anything I do with the dashed lines stops at the base of the figures…
Popyd10
  • 23
2
votes
0 answers

subfigure not working

I have this test document \documentclass{article} \usepackage{subcaption} \usepackage{graphicx} \begin{document} \begin{figure} \centering \begin{subfigure}{0.4\textwidth} \includegraphics[width=\textwidth]{example-image} \caption{Firts…
Akut Luna
  • 121
1
2 3 4 5