Issue #29: Disable striped tables per default. Enable them with the option table-use-row-colors: true.

This commit is contained in:
Wandmalfarbe 2019-08-04 16:47:49 +02:00
parent 0afdba6c59
commit 86bf7c0d97

View File

@ -612,17 +612,12 @@ $if(tables)$
\setlength\heavyrulewidth{0.3ex} % thickness of \toprule, \bottomrule
\renewcommand{\arraystretch}{1.3} % spacing (padding)
$if(table-use-row-colors)$
% TODO: This doesn't work anymore. I don't know why.
% Reset rownum counter so that each table
% starts with the same row colors.
% https://tex.stackexchange.com/questions/170637/restarting-rowcolors
\let\oldlongtable\longtable
\let\endoldlongtable\endlongtable
\renewenvironment{longtable}{
\rowcolors{3}{}{table-row-color!100} % row color
\oldlongtable} {
\endoldlongtable
\global\rownum=0\relax}
%
% Unfortunately the colored cells extend beyond the edge of the
% table because pandoc uses @-expressions (@{}) like so:
%
@ -630,6 +625,14 @@ $if(tables)$
% \end{longtable}
%
% https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions
\let\oldlongtable\longtable
\let\endoldlongtable\endlongtable
\renewenvironment{longtable}{
\rowcolors{3}{}{table-row-color!100} % row color
\oldlongtable} {
\endoldlongtable
\global\rownum=0\relax}
$endif$
$endif$
%