Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % \documentclass[sans,math,palette=es]{bmc}
- \documentclass{article}
- \usepackage{etoolbox}
- \usepackage{booktabs}
- \usepackage[table]{xcolor}
- \colorlet{text}{black}
- \colorlet{page}{white}
- \colorlet{tableheadcolor}{orange!30!page}
- % Use of \showrowcolors and \hiderowcolors is an idea from Ulrike
- % Fischer's answer here: <https://tex.stackexchange.com/a/494954/73317>
- \renewcommand{\toprule}{%
- \showrowcolors
- \arrayrulecolor{text}\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}%
- \arrayrulecolor{tableheadcolor}\specialrule{\belowrulesep}{0pt}{0pt}%
- \arrayrulecolor{text}%
- \rowcolor{tableheadcolor}%
- }
- \apptocmd\midrule{\hiderowcolors}{}{\FAILED}
- \makeatletter
- \let\@BTrule@ORI=\@BTrule
- \let\my@BTrule=\@BTrule
- % Modified version of \@BTrule that doesn't do \vskip\@aboverulesep, for use
- % when the corresponding vertical space should be coloured.
- \patchcmd{\my@BTrule}{%
- \ifnum\@lastruleclass=\z@\vskip\@aboverulesep\else
- }{%
- \ifnum\@lastruleclass=\z@\else
- }{}{\FAILED}
- \let\@arraycrORI=\@arraycr
- \renewcommand*{\@arraycr}{%
- \@ifnextchar\midrule\my@endtablehead\@arraycrORI
- }
- \newcommand*{\my@endtablehead}{%
- \@arraycrORI[\aboverulesep]% this colours the additional space with the
- % current row color
- \noalign{\global\let\@BTrule\my@BTrule}% temporarily modify \@BTrule
- \midrule
- \noalign{\global\let\@BTrule\@BTrule@ORI}% restore it
- \@gobble % gobble the following \midrule (which *must* be there!)
- }
- \makeatother
- \rowcolors{1}{tableheadcolor}{tableheadcolor}
- \title{Test}
- \author{Auth}
- \begin{document}
- \begin{tabular}{>{\hspace{3pt}\normalsize}l>{\hspace{5pt}}*{5}{p{7.9em}}}
- \toprule
- Category & \multicolumn{5}{l}{\normalsize Packages} \\
- \midrule
- General & etb & xpt & sil & ifd & geom \\
- & tts & ttc & frm & tps & clc \\
- \end{tabular}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment