5

When I use a \usepackage{colortbl} a space between \hline\hline in \longtable dissapears. I haven't find any solution how to put the space back, so I hope you'll help me to find it.

\begin{longtable}{|l|l|l|l|c|r|r|r|}
        \caption{{ABD}}
        \label{tab:SO}\\
\hline
        \multicolumn{1}{|l|}{{SO} - 01} & \multicolumn{7}{ c| }{AD}\\
    \hline\hline
        \multicolumn{4}{|l|}{Popis} & MJ & AD & AD & CD\\
    \hline
        \multicolumn{4}{|l|}{AD }& $3$ & 37000 & 0,32& 11\,800   \\
    \hline
\end{longtable} 
1
10

enter image description here

colortbl loads a load of code at \begin{document} checking for longtable and ensuring compatibility. If you stop it doing that then things work better. I blame the package authors of the colortbl and longtable packages for not communicating.

\documentclass{article}
\usepackage{color}
\makeatletter
\let\xx@begindocumenthook\@begindocumenthook
\let\xxhline\hline
\let\xx@xhline\@xhline
\usepackage{colortbl}
\let\hline\xxhline
\let\@xhline\xx@xhline
\let\@begindocumenthook\xx@begindocumenthook
\makeatother
\usepackage{longtable}
\begin{document}\color{black}
\begin{longtable}{|l|l|l|l|c|r|r|r|}
        \caption{{ABD}}
        \label{tab:SO}\\
\hline
        \multicolumn{1}{|l|}{{SO} - 01} & \multicolumn{7}{ c| }{AD}\\
    \hline\hline
        \multicolumn{4}{|l|}{Popis} & M J & AD & AD & CD\\
    \hline
        \multicolumn{4}{|l|}{AD }& $3$ & 37000 & 0,32& 11\,800   \\
    \hline
\end{longtable} 
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.