147
votes
I can't figure out why my ref is displaying question marks instead of a figure number regarding a float
The \label should always be after \caption:
Please see figure \ref{loginMock}.
\begin{figure}[H]
\centering
\includegraphics[width=7cm]{loginIdea}
\caption{Landing/Login Page Example}
...
104
votes
How to put the caption below the listing?
[Answer from OP, originally edited into question]
I found a solution.
\begin{lstlisting}[caption={My Caption},captionpos=b]
Community wiki
61
votes
Change caption name of figures
This is a simple solution:
\usepackage[figurename=Fig.]{caption}
Works with and without babel. Use tablename for tables.
56
votes
Force figure placement in text
One solution not mentioned by any of the other answers that just sorted me out is to use \clearpage
No special packages are needed.
\clearpage forces all figures above it in the .tex file to be ...
46
votes
The space between the table and its caption is very small
My attention was drawn to this question by another one that had been posted on TeX-LaTeX Meta. In spite of having been asked almost six years ago, not only—IMHO, of course!—is this question still ...
44
votes
No caption number for figures and tables
You can also use \caption* when using the caption package which keeps only the caption title.
You may do something else what did not work, but this example works as desired:
\documentclass{article}
\...
39
votes
Align Caption to the left
You should add the following instruction to the preamble, after loading the caption package:
\captionsetup{justification=raggedright,singlelinecheck=false}
If you want "hanging indentation" of ...
39
votes
Why are figures unnumbered with beamer?
This is conceptual rather than technical decision by the original author of beamer, Till Tantau. When giving a presentation, the expectation is that the presenter will talk about figures (or other ...
Community wiki
38
votes
TeXLive Pretest 2018: beamer and subfig collide
It is enough to add a definition of the command to \relax
\documentclass{beamer}
\usepackage{subfig}
\makeatletter
\let\@@magyar@captionfix\relax
\makeatother
\begin{document}
test
\end{document}
...
30
votes
How can I modify vertical space between figure and caption?
You can use the caption package for this:
\usepackage[skip=2pt]{caption} % example skip set to 2pt
This will effect all figures.
The documentation says:
The vertical space between the caption ...
28
votes
Accepted
Different font sizes for Figure and Subfigure Captions
You can use the [sub] optional parameter of \captionsetup, e.g.
\captionsetup{font=normalsize,labelfont={bf,sf}}
\captionsetup[sub]{font=small,labelfont={bf,sf}}
BTW, I would add a \centering in ...
Community wiki
27
votes
Accepted
Reference subfigure by letter only
Use the \subref-command (from section 6.1 in the subcaption docs):
\documentclass{article}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{minipage}[b]{.5\...
26
votes
Font size of Figure Caption Header
Not sure why but the answer above did not work for me. If that's the case for you, simply declare:
\usepackage{caption}
\captionsetup[figure]{font=small}
For more detail see: Changing Figure ...
26
votes
Why are figures unnumbered with beamer?
However, if you anyway persist to have numbered figures (after reading @Joseph Wright answer at least twice :) ), you need add to preamble:
\setbeamertemplate{caption}[numbered]
i.e.:
\...
24
votes
Caption on the side of a figure
Use the sidecap package.
\usepackage{sidecap}
\begin{SCfigure}
\includegraphics{fig}
\caption{Foo bar}
\end{SCfigure}
See vertical position of sidecap figure w.r.t. top aligned caption
23
votes
Accepted
How can I specify a short caption for a listing?
listings' caption key allows you to use the same syntax as
\caption[short title]{long title}
but you have to wrap braces around the value that you pass to the caption key, in order to "hide" the ...
23
votes
Accepted
text, margin, and text + margin width floats without using tufte class
You could use the sidenotes-package:
\documentclass[twoside]{scrartcl}
\usepackage{showframe}
\usepackage{graphicx}
\usepackage{placeins}
\usepackage{sidenotes}
\usepackage{...
21
votes
Accepted
How to insert "source" below image
\documentclass{article}
\usepackage{graphicx}
\usepackage[x11names]{xcolor}
\usepackage{copyrightbox}
%%%% figure-copyright
\usepackage{url}
\begin{document}
\begin{figure}[!h]
\copyrightbox[...
19
votes
Accepted
Only one caption under multiple subfigures
You can put all figures of a row in only one subfigure environment.
Example (assuming package subcaption is used):
\documentclass{article}
\usepackage{subcaption}
\usepackage[demo]{graphicx}
\begin{...
17
votes
Width of the caption of a figure
Instead of using a predetermined width, one can measure the width using a savebox and put the caption inside a minipage.
\documentclass{article}
\usepackage{graphicx}
\usepackage{blindtext}
\begin{...
16
votes
Accepted
It is possible to print the title of a plot below the x axis?
Lets summarize and extend above comments. The first and the last (from John Kormylo and mine) propose solution to place graph title as part of graph, the second propose to omit title as part of graph ...
15
votes
How can I left-align a caption?
Put \captionsetup{singlelinecheck = false, justification=justified} after \begin{figure} would solve the problem.
15
votes
Accepted
KOMA-Script and sidenotes : how to format side (margin) caption and its caption label?
The sidenotes package uses package caption to define a caption style sidecaption. You can redeclare this style:
\documentclass{scrartcl}
\usepackage[T1]{fontenc}% <- added
\usepackage{lipsum}
\...
15
votes
Accepted
Error: Illegal parameter number in definition of \reserved@a
\overrightarrow is not robust and breaks in moving arguments. Protect it with \protect:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{caption}
\usepackage[mathscr]{...
14
votes
Accepted
Add both a vertical side caption and a normal caption to a picture
The copyrightbox package is done precisely for that:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{ebgaramond}
\usepackage{graphicx}
\usepackage[x11names]{...
14
votes
Accepted
Why does LaTeX step the footnote counter twice in a two-line caption?
It steps it because the caption is typeset twice. Firstly it is set in an \sbox and measured, and if that one-line setting would fit the box is centred, however if that line would be too long, the ...
13
votes
Force figure placement in text
You can now use the adjustbox package to turn your boxed stuff into a non-floating float replacement using the nofloat=<type> key. Caption and label can be added by own keys, before the nofloat. ...
13
votes
How to reduce space between image and its caption?
For locally change the caption position you can also use a negative value on the setting. For example, when the figure has larger white part, e.g use \vspace{-1cm}, instead of changing the figure ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
captions × 3727floats × 872
tables × 604
subfloats × 293
subcaption × 292
graphics × 201
longtable × 199
horizontal-alignment × 198
table-of-contents × 183
cross-referencing × 163
listings × 163
spacing × 140
tikz-pgf × 128
numbering × 112
minipage × 112
positioning × 103
beamer × 93
floatrow × 82
formatting × 79
memoir × 75
koma-script × 73
labels × 68
hyperref × 67
footnotes × 65
errors × 58