Skip to main content
110 votes
Accepted

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]
60 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 ...
tom's user avatar
  • 798
48 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 ...
GuM's user avatar
  • 21.7k
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 ...
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} ...
David Carlisle's user avatar
31 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 ...
Markus Weninger's user avatar
31 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 ...
user659986's user avatar
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\...
Andreas Storvik Strauman's user avatar
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.: \...
Zarko's user avatar
  • 300k
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[...
Zarko's user avatar
  • 300k
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{...
esdd's user avatar
  • 86.1k
18 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{...
John Kormylo's user avatar
  • 81.2k
15 votes

How can I left-align a caption?

Put \captionsetup{singlelinecheck = false, justification=justified} after \begin{figure} would solve the problem.
user125659's user avatar
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} \...
esdd's user avatar
  • 86.1k
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]{...
Heiko Oberdiek's user avatar
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 ...
David Carlisle's user avatar
14 votes
Accepted

Using hyperref's \hyperlink command inside \caption in figure environment

Protect the command: \documentclass{article} \usepackage{caption} \usepackage{hyperref} \begin{document} \hypertarget{ACRONYM}{Its definition...} \begin{figure} blub \caption{This process ...
Ulrike Fischer's user avatar
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. ...
Martin Scharrer's user avatar
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 ...
Alan Ayala's user avatar
13 votes
Accepted

Package caption Error: 9pt undefined

caption knows only a specific set of font keywords. If you want something special you must setup the keyword first: \documentclass{memoir} \usepackage{caption} \DeclareCaptionFont{9pt}{\fontsize{9pt}{...
Ulrike Fischer's user avatar
12 votes

How to force table caption on top?

The location of the caption is traditionally underneath the float. However, it is up to you to therefore insert the caption command after the actual contents of the float (but still within the ...
Shatakshi's user avatar
  • 121
12 votes

Use caption and long description for figure

The solution is very simple and does not need any vertical adjustment (i.e., \vspace). Instead of \caption[Short Title]% {Long Description} try: \caption[Short Title]% {Short Title \par \small Long ...
Borhan Kazimipour's user avatar
12 votes

\usepackage{caption} breaks references to tables

Had kind of the same Error, but for me the solution was, putting the \label after the \caption command (which makes kind of sense...)
Marcel's user avatar
  • 454
12 votes

How to remove figure caption prefix "figure" in beamer

None of the answers worked for me, I had the same problem. I tried this one in the preamble and it does the job requested: \captionsetup{labelformat=empty,labelsep=none}
user107819's user avatar
12 votes

How to align caption to the left of a figure?

You can load the caption package and choose the option singlelinecheck=off, and the measuredfigure environment from threeparttable: \documentclass[conference]{IEEEtran} \usepackage[utf8]{inputenc} % ...
Bernard's user avatar
  • 273k
12 votes
Accepted

Square with a cross in it as a figure caption using tikz in latex

I don't think there is a real need for tikz in this case. The following and many others are available from amssymb, see Math symbols defined by LaTeX package amssymb. \documentclass{article} \...
AboAmmar's user avatar
  • 46.7k
12 votes

Problem compiler error about figure/subfigure ' caption using latex IEEE ACCESS template

They provide a new command to handle the images in IEEE Access. I show you an example. \Figure[!t]()[width=0.95\textwidth]{imageName} {Caption.\label{fig:label}} This command puts the image using ...
Pedro A. Marin-Reyes's user avatar
12 votes

How to insert "source" below image

Set your image in a tabular that has a single right-aligned column: \documentclass{article} \usepackage{graphicx} \newcommand{\imagesource}[1]{{\footnotesize Source: #1}} \begin{document} \begin{...
Werner's user avatar
  • 607k
11 votes

The space between the table and its caption is very small

Try this before caption: \bigskip
isk27's user avatar
  • 317

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