Skip to main content
The 2024 Developer Survey results are live! See the results
58 votes
Accepted

Controlling subfigure captions and subfigure placement

The optional argument for the subfigure environment provides the placement of the sub-caption anchor. This is used to align the sub-captions vertically. Here is a visual: \documentclass{article} \...
Werner's user avatar
  • 608k
25 votes
Accepted

aligning the captions for the side-by-side subfigures

Just use the optional [t] argument from subcaption: \documentclass{article} \usepackage{graphicx,subcaption} \begin{document} \begin{figure} %\centering -> This is irrelevant because of the '.5\...
Guilherme Zanotelli's user avatar
12 votes

Align top of images using subcaption

Newer solution For anyone who come across this issue with subcaption package >= v1.2, there is a built-in argument for that: \begin{subcaptionblock}[⟨outer-pos⟩][⟨height⟩][⟨inner-pos⟩]{⟨width⟩} ......
Accident2ly's user avatar
11 votes

Package caption Warning: Unsupported document class

In many cases, there are no problems in spite of the warning. Since subfig.sty is older then captions.sty, using caption.sty is not bad choice. If you want to understand why you get the warning, "5 ...
rkoyama1623's user avatar
10 votes

Controlling subfigure captions and subfigure placement

Use the subfigure option [t] instead of [b]. To add some horizontal space between the figures, put \quad, \qquad, \hfill or some \hspace command between the subfigure environments. . \documentclass{...
gernot's user avatar
  • 50k
10 votes
Accepted

Package caption Warning: Unsupported document class

The spconf.sty package uses deprecated and obsolete constructions, so it's not very surprising it is not compatible with caption. You can use subfig, though. Of course, the template file does ...
egreg's user avatar
  • 1.1m
9 votes
Accepted

What does `\centering` do?

Well, it seems there is a bug (or is it a feature?) in your used class IEEEtran. Or it results in the using of package subfigure, which called package caption. And that package caption results in the ...
Mensch's user avatar
  • 65.6k
9 votes
Accepted

Understanding the difference between \hspace and \hspace* when placing subfigures side-by-side

The row of images is too wide for the line. \hspace introduces a breakpoint so the line breaks after the B and the space is discarded at the start of the next line. with \hspace* no line break is ...
David Carlisle's user avatar
9 votes

Subcaption package error: aastex61

When you try compiling your example, you get Package caption Warning: Unsupported document class (or package) detected, (caption) usage of the caption package is not recommended. See ...
egreg's user avatar
  • 1.1m
9 votes
Accepted

Problem with label and references and subfig/subcaption

There are basically three way to add a label: before caption - wrong (the caption increments the counter of figures, so you have to not put the label before the counter is updated) inside caption - ...
gvgramazio's user avatar
  • 2,680
9 votes

Using subfigure and creating two rows of figures?

You wrote, I keep getting errors You didn't mention which errors you are getting, but I can only assume that they are caused by the line \begin{subfigure}[0.45\textwidth] at the start of the ...
Mico's user avatar
  • 515k
9 votes
Accepted

Subfigures in MDPI template Overleaf

I assume you downloaded the class mdpi and put it in a new directory. It should have a file template.tex and a Definitions subdirectory. The class mdpi defines \captionsetup for figure but not for ...
Simon Dispa's user avatar
  • 39.6k
9 votes
Accepted

Display math in \savebox?

display math like a paragraph is always full width (\hsize) so to store in a box you need to use a \parbox so it can hold vertical material \sbox{\mybox}{\parbox{4cm}{\[ 2 + 2 \]}} will work but not ...
David Carlisle's user avatar
8 votes
Accepted

Reference pgfplots' groupplot with subcaption

Use \subcaption{\label{fig:a}} and \subcaption{\label{fig:b}} to set the subcaptions. Code: \documentclass{article} \usepackage{caption} \usepackage{subcaption} \usepackage{pgfplots} \pgfplotsset{...
esdd's user avatar
  • 86.1k
8 votes

Two tables side by side with independent and global captions

It works with either subcaption: or with floatrow (which makes it easy to have side captions): I supposed you wanted the row of subtables to be displayed across both columns. Here's the code, which ...
Bernard's user avatar
  • 273k
8 votes

1 picture of 4 not completely aligned

As @UlrikeFischer has already suggested in a comment, the uneven-whitespace issue disappears if you insert a blank line after the second of four subfigure environments. However, this comes at the cost ...
Mico's user avatar
  • 515k
7 votes

Vertical alignment of subfigures with different subcaptions length

You could just insert \newline to the shorter caption. Worked for me, the other solutions looked too complicated :)
Arno Scholtz's user avatar
7 votes

Combining cleveref and subref

A work around is to define your own 'partially-clever' command by adding this to the preamble: \newcommand{\csubref}[2]{\namecref{#1}~\subref{#1:#2}} However this requires a strict labelling scheme ...
Matthias Arras's user avatar
7 votes

Combining cleveref and subref

You can adjust the behaviour of cleveref as follows and then simply use \cref{sub@fig:a} in the text. If you just use subcaption and look in the .aux file you will see that a \label{fig:a} in a ...
Andrew Swann's user avatar
  • 96.3k
7 votes

How to have 2x1 subcaption structure?

Something like this? \documentclass{article} \usepackage[showframe]{geometry} \usepackage{graphicx} \usepackage{subcaption} % subfigure \begin{document} \begin{figure} \centering ...
Troy's user avatar
  • 13.8k
7 votes
Accepted

Using tiny font with the (sub)caption package

While the tiny option is not available per default, it can easily be added using \DeclareCaptionFont{tiny}{\tiny} \documentclass{article} \usepackage{graphicx} \usepackage{subcaption} \...
samcarter_is_at_topanswers.xyz's user avatar
7 votes
Accepted

Real footnote with subcaption package

You can use a \footnotemark and \footnotetext pair: \documentclass{article} \usepackage{graphicx} % To display subfigures \usepackage{caption} \usepackage{subcaption} \begin{document} \begin{figure}[...
Phelype Oleinik's user avatar
7 votes
Accepted

A particular customize with green line and letters for subfloat

As far as I can tell, it's just a line so \documentclass[12pt]{book} \usepackage{newtxtext} %%%%%\usepackage{classico}%%%%%%%%% urw-classico package. The fonts are installed into my MikTeX ...
David Carlisle's user avatar
7 votes

Unable to place figures side by side using subcaption

Because you gave us no minimal working example (MWE) (please add it in you next question!) I have a little bit to guess. Please see that I used package showframe to visualize typing area and margins. ...
Mensch's user avatar
  • 65.6k
7 votes
Accepted

Subfigures are coming out strangely staggered, I want them to be side by side

[a] and [b] are NOT meaning what you think. The optional argument to subfigure is a vertical alignment. Your valid choices are [t], [c], or [b] (and also [T] and [B], see documentation, https://ctan....
Steven B. Segletes's user avatar
7 votes
Accepted

"\vspace{-number cm}" between "subfigure" and "subcaption" works in back direction in LaTeX

LaTeX starts horizontal mode when a image is inserted by \includegraphic. I.e. the image is a first letter of a paragraph. Then a space is here from the end of line a then \vadjust which is a ...
wipet's user avatar
  • 75.7k
7 votes
Accepted

13 figures OK, 14 figures gives ! LaTeX Error: Counter too large. only with tex4ht and subfigure

It seems that the subfigure counter doesn't reset at the beginning of each figure. Each subfigure environment updates it and prints as an alphabetic label. Once you run out of the letters in alphabet, ...
michal.h21's user avatar
  • 51.3k
6 votes

How to align multiple subfigures in a grid?

Within a figure environment you can start a tabular environment to have more control over the distribution of space. Fill the tabs with subfigures. You can even use the multirow package for even ...
EA304GT's user avatar
  • 401

Only top scored, non community-wiki answers of a minimum length are eligible