I am trying to use a coloured \cmidrule
in a table in beamer
– however, it does not show up. I have read Strange disappearing colored rules in beamer which indicates that this is a bug and discusses reasons and some possibilities to fix things by adding \kern
. However, it does not actually show how to apply this to \cmidrule
, just to other \hrule
commands. My questions is: how do I apply this to \cmidrule
? or is that not feasible?
MWE
\documentclass[pdftex,12pt,fleqn,xcolor=pdftex,table,usepdftitle=false]{beamer}
\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}
\usepackage[T1]{fontenc}
\usepackage{bera}
\usepackage{arevmath}
\usepackage{booktabs}
\usecolortheme{shark}
\useoutertheme[glossy]{wuerzburg}
\begin{document}
\begin{frame}
\frametitle{booktabs with cmidrule}
\rowcolors*{2}{black!5}{structure!22}\arrayrulecolor{structure}
\begin{tabular}{lrrrrrr}
\toprule
& \multicolumn{6}{c}{Penalty} \\
\cmidrule{2-7}
$\hat{\lambda}_{i}$
& None & a & b & c & d& e \\
\midrule
1 & 10& -11& -4& -8& 8 & 3\\
2 & 10& -11& -4& -8& 8 & 3\\
\bottomrule
\end{tabular}
\end{frame}
\end{document}
Best Answer
Commenting on the linked question, Herbert states
The definition of
\hrulefill
isThe
booktabs
commands that include\leaders
in their definition are\@cmiderulea
and\@cmidruleb
:It seemed worth a try to add
\kern\z@
after\hfill
to both definitions. (For convenience, I used theetoolbox
package to do so.) And indeed: