0

This question is similar to the one asked here: Hang with custom Declare caption Format

My issue is, that i can't make my customized captions appear with the indentation that 'format=hang' normally provides. I tried using \DeclareCaptionFormat but that doesn't seem to work. An examplary code is:

\documentclass[12pt,a4paper]{article}
\multirow
\usepackage{subcaption}
\DeclareCaptionFormat{customtab}{\captionsetup{format = hang}\textbf{#1#2}#3}
\captionsetup{format=customtab}

\begin{document}
\begin{table}[h!]
\centering
\caption{Example of a tablecaption that is too for this line and instead needs to be continued in the next line, making the caption consist of two lines}
\begin{tabular}{*6c}
    \hline
    & & A & B & C & D \\
   \hline \rowcolor{gray!40}
    &  &  &  &  &  \\ \rowcolor{gray!40}
    \multirow{-2}{*}{Example} &  &  &  &  &  \\
\label{example}
\end{table}
\end{document

but i just get this:result yielded with \DeclareCaptionFormat

I've looked for a workaround in the documentation "Customizing captions of floating environments∗": https://texdoc.org/serve/caption/0 but so far couldn't find one.

1 Answer 1

0

Just use format=hang and labelfont=bf.

\documentclass[12pt,a4paper]{article}
\usepackage{caption}

\captionsetup{format=hang,labelfont=bf}

\begin{document}

\begin{table}[htp]
\centering

\caption{Example of a tablecaption that is too for this line
and instead needs to be continued in the next line, making
the caption consist of two lines}

\end{table}

\end{document}

output

1
  • thanks so much !
    – eli saas
    Commented Aug 24 at 20:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .