[edit] Overleaf guides

[edit] LaTeX Basics

[edit] Mathematics

[edit] Figures and tables

[edit] References and Citations

[edit] Languages

[edit] Document structure

[edit] Formatting

[edit] Fonts

[edit] Presentations

[edit] Commands

[edit] Field specific

[edit] Class files

Adding a caption to a floating environment (for images, figure provides a floating environment) is very easy. We can simply add the following command to the figure environment -

\caption{caption text}

We do not need to include the figure number inside the caption, because LaTeX automatically keeps track of the numbering of the figures, and it'll display it while displaying the caption. The following is an example of a caption inside a figure environment.

  \caption{A picture of the universe!}

The caption may be put either before or after the image in the figure.

[edit] Side Captions in a Figure

At times, we might want to put the caption on the side instead of at the top or bottom of the figure. The sidecap package can be used to place a caption next to the figure in such a case (it can also be used for other floating environments). The package uses an environment called SCfigure that can be used after including the package in preamble (\usepackage{sidecap})

  \caption{This is the same picture of the universe as above, but now the captions appear in the side next to the image}

[edit] List of Figure

A list of all the figures included in a document can be generated with the following command -