beamer
beamer copied to clipboard
beamer \unskip fun breaks colortbl
With example
\documentclass{beamer}
\usepackage{colortbl}
\usepackage{hhline}
\usepackage{etoolbox}
\begin{document}
\begin{tabular}{|c|c|}
\hhline{>{\arrayrulecolor{blue}}->{\arrayrulecolor{black}}-}
Cell 1&Cell 2\tabularnewline
\hhline{->{\arrayrulecolor{blue}}-}
\end{tabular}
\makeatletter
\patchcmd\HH@loop
{\arrayrulewidth\hfil}% search
{\arrayrulewidth\hfil\kern\z@}% replace
{}% success
{\errmessage{Patching \string\HH@loop\space failed}}% failure
\makeatother
\begin{tabular}{|c|c|}
\hhline{>{\arrayrulecolor{blue}}->{\arrayrulecolor{black}}-}
Cell 1&Cell 2\tabularnewline
\hhline{->{\arrayrulecolor{blue}}-}
\end{tabular}
\end{document}
The lines come out wrong: this is due to some \unskip
oddness in beamerbasecolor.sty
. Changing the code is easy ... question is why are those lines there!
I suspect this was 'tidying up' some stray spaces in the code ...
BTW, introduced in current form more-or-less in 81ab64f50af7f528c369bdd044efef5d752d7749.
What's the exact usage of these hooks?
On 1 December 2017 at 03:35, Louis Stuart [email protected] wrote:
So this \unskip token swallows \hfil in \leaders?
leaders internally are a kind of "decorated glue node" and \unskip removes the entire leaders node.
In case this gets resolved eventually, please comment on the related questions https://tex.stackexchange.com/questions/404872/are-beamer-hhline-and-tablexcolor-incompatible and https://tex.stackexchange.com/q/404661/36296
\cline
has a similar problem, see https://tex.stackexchange.com/q/159378
Example:
\documentclass{beamer}
\usepackage{colortbl}
\begin{document}
\arrayrulecolor{red}
\leavevmode\bigskip\par
Before patch\par
\begin{tabular}{ccc}
\hline
a & b & c \\ \cline{2-2}
a & b & c \\ \hline
\end{tabular}
\makeatletter
% patch from https://tex.stackexchange.com/a/159383, by Heiko Oberdiek
\patchcmd\@cline
{\arrayrulewidth\hfill}% search
{\arrayrulewidth\hfill\kern\z@}% replace
{}% success
{\errmessage{Patching \string\@cline\space failed}}% failure
\makeatother
\leavevmode\bigskip\par
After patch\par
\begin{tabular}{ccc}
\hline
a & b & c \\ \cline{2-2}
a & b & c \\ \hline
\end{tabular}
\end{document}
I guess this is still open on my side
https://tex.stackexchange.com/questions/404872/are-beamer-hhline-and-tablexcolor-incompatible#comment1009168_404903