Skip to content

Commit

Permalink
add fix for rowcolors (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfenner committed Nov 25, 2023
1 parent 0e59d0e commit 40dbc7c
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions eisvogel.tex
Original file line number Diff line number Diff line change
Expand Up @@ -718,25 +718,18 @@
\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
%
% Unfortunately the colored cells extend beyond the edge of the
% table because pandoc uses @-expressions (@{}) like so:
%
% \begin{longtable}[]{@{}ll@{}}
% \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}
\usepackage{etoolbox}
\AtBeginEnvironment{longtable}{\rowcolors{2}{}{table-row-color!100}}
\preto{\toprule}{\hiderowcolors}{}{}
\appto{\endhead}{\showrowcolors}{}{}
\appto{\endfirsthead}{\showrowcolors}{}{}
$endif$
$endif$
Expand Down

0 comments on commit 40dbc7c

Please sign in to comment.