0

Given the table

\documentclass{scrartcl}

\usepackage{booktabs,caption}

\begin{document}

\begin{table}[htb] \centering \caption{Test table} \begin{tabular}{lll} \toprule abc & def & ghi \ \midrule abc1 & def2 & ghi3 \ \bottomrule \end{tabular} \caption*{Source: xyz} \end{table}

\end{document}

How can I change the space before and after the starred caption (from the caption package) without affecting the unstarred caption? And is this possible for any (un)starred command to be changed without affecting the other?

Lukas
  • 659
  • Are you more looking for a footnote in the table than a second unnumbered caption? – Arash Esbati Jan 03 '22 at 14:14
  • It is kind of a footnote, yes. But it should be the same font, size etc. as the text of the caption above the table and it should be usable inside all kind of floats (table, figure and a float generated by me with Koma called eq, which the starred caption provided – Lukas Jan 03 '22 at 14:22
  • Do you mean horizontal space or vertical space? Maybe \end{tabular}\\[2mm]Source: xyz\end{table} would suffice? This works also for figures, and possibly also for your custom float. – Marijn Jan 03 '22 at 19:58

1 Answers1

0

In combination with this answer I added a command to change abovecaptionskip and belowcaptionskip inside a group to save the both previous lengths as well as restore them afterwards:

\documentclass{scrartcl}

\usepackage{booktabs} \usepackage[% font=small,% labelfont=bf,% justification=justified,% singlelinecheck=false,% format=plain]{caption}%

\newcommand{\source}[1]{Source: #1}% \newcommand{\captionskip}[1]{% \begingroup% \setlength{\abovecaptionskip}{0pt plus 2pt}% \setlength{\belowcaptionskip}{0pt plus 2pt}% \caption*{\source{#1}}% \par\endgroup% }

\begin{document}

\begin{table}[htb]
    \centering
    \caption{Test table}
    \begin{tabular}{lll}
        \toprule
        abc &   def &   ghi     \\ \midrule
        abc1    &   def2    &   ghi3    \\ \bottomrule
    \end{tabular}
    \captionskip{Test}
\end{table}

\end{document}

Lukas
  • 659