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
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.