# Space between table caption and caption text

At the moment, I have the following code in the preamble:

\usepackage[justification=justified,singlelinecheck=false]{caption}


This creates a nice space between the table caption and the caption text. However, I would also like to add a colon after the table number, and at the same time have the separation between the colon and the caption text. As far as I know, \captionsetup only allows one attribute for labelsep. Is there an easy way to accomplish this?

Yes, there is. The caption package provides the command \DeclareCaptionLabelSeparator to define your own caption label separator.

So, declaring

\DeclareCaptionLabelSeparator{mysep}{:\quad}


and using

\captionsetup{format=hang, labelsep=mysep}


you can obtain what you want.

MWE:

\documentclass{article}
\usepackage{caption}
\usepackage[justification=justified,singlelinecheck=false]{caption}
\captionsetup{format=hang, labelsep=mysep}
\begin{document}

\begin{table}
\centering
\begin{tabular}{c}
\hline
hello \\
\hline
\end{tabular}
\caption{A table}
\end{table}

\end{document}


• @user81520 You're welcome. – karlkoeller Jul 27 '15 at 12:06

As far as I know captions of tables go above the table. If you do this, you can just add a little space to the line separator \\ like this:

\documentclass{article}

\begin{document}

\begin{table}
\centering
\caption{A table} %captions go atop of a table
\begin{tabular}{c}
\\[1pt]  %This is the important part
\hline
hello \\
\hline
\end{tabular}
\end{table}

\end{document}


Hope this helps!