# [Tex/LaTex] How to give floats/figures titles

captionsfloats

Below is an excerpt from my thesis, showing a figure with a caption.

I'd like to give the figure a title too, that is, a few words written above the figure.

Can I do that in latex? If so, how?

\begin{figure}
\includegraphics[width=\linewidth]{./graphics/chapter6/mouse.pdf}
\caption{Blablabla}
\label{fig:length_eight_mouse}
\end{figure}


The {figure} environment isn't limited to contain only figures etc. You can add anything so just type in your title above the figure.

\begin{figure}
\centering
\includegraphics[scale=0.3]{example-image}
\end{figure}


You can define a new command like \figuretitle to make the formatting and spacing consistent.

\newcommand*{\figuretitle}[1]{%
{\centering%   <--------  will only affect the title because of the grouping (by the
\textbf{#1}%              braces before \centering and behind \medskip). If you remove
\par\medskip}%            these braces the whole body of a {figure} env will be centered.
}


Looks the same as above, but can be used as

\begin{figure}
\centering
\includegraphics[scale=0.3]{example-image}
\end{figure}


Or you can use the \caption above the figure. In this case you may use the caption package to adjust the spacing.

\documentclass{article}

\usepackage{graphicx}

\usepackage{caption}
\captionsetup[figure]{
position=above,
}

\begin{document}
\begin{figure}
\centering