Coloured Tables for the Memoir Class

So long as that colour isn't yellow. I hate yellow.

Reading time: about 1 minute (301 words).

If you're a fan of LaTeX typography, you may have come across the Motion Mountain set of physics textbooks. This long term project has its own class file, which has been tweaked and honed over many years, has seen many of its pages grace many typography showcases (not to mention commercial successes and other recognitions). One particular stylistic choice that piqued my interest was the use of coloured rules inside the \table{} environment.

There colortbl package (available on CTAN), with albeit hideous examples, allows for the inclusion of colour into tables; usually to highlight cells, but with a bit of finesse can be persuaded to alter the rule colour also.

Add this to your preamble:

    \makeatletter
    \def\rulecolor#1#{\CT@arc{#1}}
    \def\CT@arc#1#2{%
      \ifdim\baselineskip=\z@\noalign\fi
      {\gdef\CT@arc@{\color#1{#2}}}}
    \let\CT@arc@\relax
    \makeatother

And set table rules via \rulecolor{color}. With a little bit of tweaking, your tables will scrub up quite well.

A Memoir class table with coloured horizontal rules
A Memoir class table with coloured horizontal rules