# Strange vertical space before the caption of a longtable with KOMA-Script classes when xcolor is loaded

When using one of the main KOMA-Script classes — scrartcl, scrreprt, scrbook but not scrlttr2 —, the vertical position of the caption in a longtable environment changes when one loads or unloads the xcolor package: if the latter is loaded, there is an additional spacing above the caption.

Here is a minimal working example.

\documentclass[a4paper]{scrartcl}% scrartcl, scrreprt, scrbook

\usepackage{xcolor}% comment and uncomment to see the effect
\usepackage{longtable}

\begin{document}
%
\noindent%
\centering%
Blah blah blah blah.
\begin{longtable}{l l l l}
\hline
\caption{Caption} \\
\hline
\hline
\endfoot
Cell & Cell & Cell & Cell \\
Cell & Cell & Cell & Cell \\
\end{longtable}
Blah blah blah blah.
%
\end{document}


The result is given in the following picture.

The problem also happens if I load xcolor after longtable or if I put the caption at the foot of the table. But, if I load the caption package, the additional space disappears and the result is the first — expected — one in every case. I just don’t need this additional package, provided that I can get what I want with the commands and options from the KOMA-Script classes. Finally, there is no such situation with the standard classes, whether the package caption is loaded or not.

(Just a few remarks about my code: I have only inserted the \hline before the caption to make the situation clearer, and the problem still occurs without it; furthermore, in a final version, I would obviously use \captionabove instead of \caption or the KOMA-Script option captions=tableheading, as well as booktabs!)

The question is: how do I get rid of the additional space without loading the caption package?

I have a subsidiary question: why is the spacing after the longtable environment greater than the spacing before? By default, both lengths \LTpre and \LTpost are defined as equal to \bigskipamount, in the longtable package.

• This seems a bug in the KOMA-Script classes. It doesn't happen with article. With scrartcl there is an additional space anyway. Jun 11 '13 at 23:15
• You should contact Markus Kohm or file a bug report at komascript.de or developer.berlios.de/projects/koma-script3 Jun 12 '13 at 9:07
• @cgnieder I reported the bug: developer.berlios.de/bugs/…. For the time being, I will use the caption package. Jun 12 '13 at 11:00

\def\capfont{\leavevmode\normalfont\normalcolor}

which adds \leavevmode