I'm using sphinx to generate documentations. The tables it produces via latex are pretty ugly, so I'd like to give them some global styling. What I'd like to achieve is
- Always 100% width
- A header row color
- Bold header text
- Maybe some more spacing
So what sphinx does is it writes tables like this:
\begin{tabulary}{\linewidth}{|L|L|L|}
\hline
\textsf{\relax
Nummer
} & \textsf{\relax
Name
} & \textsf{\relax
Bemerkungen
}\\
\hline
0
&
Allgemeines
&
Enthält Meta-Informationen zum Dossier
\\
[...]
\hline\end{tabulary}
My approach was something like this (for the header row color):
\RequirePackage{tabu}
\definecolor{tablehead}{rgb}{0.7294117647058823, 0.6823529411764706, 0.6235294117647059}
\renewenvironment{tabulary}[2]{\bgroup\begin{tabu} to \textwidth{#2}
\rowcolor{tablehead}
}%
{\end{tabu}\egroup}
This results in following error:
! Missing # inserted in alignment preamble.
<to be read again>
&
l.294 \hline\end{tabulary}
? x
Best Answer
The
L
column type is useless as far astabu
is concerned.Note that we have to swallow the first
\hline
otherwise and place it by hand, because it's illegal after\rowcolor
.