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
\bgroup
and\egroup
? They serve no purpose whatsoever. Did you try with\tabu
and\endtabu
instead of\begin{tabu}
and\end{tabu}
? – egreg Apr 1 '15 at 11:10