summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/colortbl
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/colortbl
Initial commit
Diffstat (limited to 'macros/latex/contrib/colortbl')
-rw-r--r--macros/latex/contrib/colortbl/README.txt7
-rw-r--r--macros/latex/contrib/colortbl/colortbl-DE.pdfbin0 -> 325398 bytes
-rw-r--r--macros/latex/contrib/colortbl/colortbl-DE.tex547
-rw-r--r--macros/latex/contrib/colortbl/colortbl.dtx1331
-rw-r--r--macros/latex/contrib/colortbl/colortbl.ins5
-rw-r--r--macros/latex/contrib/colortbl/colortbl.pdfbin0 -> 269378 bytes
6 files changed, 1890 insertions, 0 deletions
diff --git a/macros/latex/contrib/colortbl/README.txt b/macros/latex/contrib/colortbl/README.txt
new file mode 100644
index 0000000000..542498a903
--- /dev/null
+++ b/macros/latex/contrib/colortbl/README.txt
@@ -0,0 +1,7 @@
+The colortbl package:
+
+ Add colour to LaTeX tables. Requires array and color packages.
+ Process colortbl.ins to produce the package file colortbl.sty.
+ Process colortbl.dtx to get the documentation (this requires
+ longtable hhline and dcolumn from the standard `tools'
+ distribution.)
diff --git a/macros/latex/contrib/colortbl/colortbl-DE.pdf b/macros/latex/contrib/colortbl/colortbl-DE.pdf
new file mode 100644
index 0000000000..83cd3c8589
--- /dev/null
+++ b/macros/latex/contrib/colortbl/colortbl-DE.pdf
Binary files differ
diff --git a/macros/latex/contrib/colortbl/colortbl-DE.tex b/macros/latex/contrib/colortbl/colortbl-DE.tex
new file mode 100644
index 0000000000..113bbee8af
--- /dev/null
+++ b/macros/latex/contrib/colortbl/colortbl-DE.tex
@@ -0,0 +1,547 @@
+\documentclass[ngerman]{article}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{babel}
+
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{1ex plus 0.2ex minus 0.1ex}
+
+\usepackage{dcolumn,longtable,hhline,colortbl}
+\usepackage[table]{xcolor}
+\setlongtables%
+\begin{document}
+
+\def\slash#1{\textbackslash#1}
+
+ \title{The \textsf{colortbl} package\footnote{1.\,"Ubersetzungsversion,
+ letzte "Anderung 15.\,3. 2009}}
+
+ \author{{\huge David Carlisle}\\ (\"Ubersetzung: Anne-Katrin Leich \& Christine
+ R"omer)}
+
+\date{\today}
+
+\maketitle
+
+\begin{abstract}
+Durch das flexible Setzen farbiger `Felder' erm"oglicht dieses Paket die
+Hintergrundgestaltung definierter Spalten in Tabellen. Dazu werden das \textsf{array}- und
+das \textsf{color}-Paket ben"otigt.
+\end{abstract}
+
+\section{Einleitung}
+
+Das Paket \textsf{colortbl} dient dem Einf"arben von Tabellen (d.\,h. der farbigen
+Gestaltung von
+Fl"achen hinter Tabelleneintr"agen). Es "ahnelt Timothy Van Zandts \textsf{colortab}-Paket.
+Die innere Anwendungsstruktur ist zwar anders, \textsf{colortab} benutzt aber wie
+\textsf{colortbl} nicht nur Tabellen-Konstruktionen von \LaTeX, sondern auch die anderer
+Formate. \textsf{colortbl} basiert also auf \LaTeX (und dessen \textsf{color}- und
+\textsf{array}- Pakete).
+
+ Zum Vergleich zun"achst eine einfache Tabelle:
+
+\begin{center}
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+\begin{tabular}{|l|c|}
+ eins & zwei\\
+ drei & vier
+\end{tabular}
+\end{verbatim}
+\end{minipage}
+{\bfseries
+ \begin{tabular}{|l|c|}
+ eins&zwei\\
+ drei&vier
+ \end{tabular}}
+ \end{center}
+
+\section{ Der \slash \textsf{columncolor}-Befehl}
+
+Die folgenden Beispiele demonstrieren verschiedene Anwendungsm"oglichkeiten des durch
+\textsf{colortbl} eingef"uhrten \slash \textsf{columncolor}-Befehls. Die vertikalen Linien,
+durch |
+definiert, werden bewusst in allen Beispielen verwendet, um die Positionierung der Spalten
+zu verdeutlichen. Auch wenn Sie vielleicht letztendlich nicht farbige
+Felder \emph{und} vertikale Linien verwenden m"ochten.
+
+Der hier genannte \slash \textsf{columncolor}-Befehl sollte (nur) als Argument im Sinne
+der >
+column-Definition gebraucht werden, um ein farbiges Feld hinter die definierte Spalte zu
+legen. Er kann in der einleitenden Pr"aambel als Argument von \textsf{array}-,
+\textsf{tabular}- und auch in \slash{multicolumn}-Definitionen eingesetzt werden.
+
+Der elementare Quelltext lautet:\\
+\slash \textsf{columncolor}[<\emph{color model}>]\{<\emph{colour}>\}
+ [<\emph{left overhang}>][<\emph{right overhang}>]
+
+Das erste Argument (oder die ersten beiden, falls das optionale Argument in Anspruch
+genommen wird) ist das "ubliche Argument des \textsf{color}-Pakets wie es
+auch bei \slash \textsf{color} auftritt.
+
+Die letzten beiden Argumente geben an, nach welchem Abstand das Feld hinter dem breitesten
+Tabelleneintrag endet.
+Wenn das Argument \emph{rechter "Uberhang} nicht in Anspruch genommen wird, entspricht es
+dem Argument \emph{linker "Uberhang}. Bleiben beide undefiniert, entsprechen sie dem vorgegebenen
+Wert von \slash \textsf{tabcolsep} (im \textsf{tabular}-Paket) oder
+\slash \textsf{arraycolsep} (im \textsf{array}-Paket).
+
+Setzt man die "Uberhang-Argumente auf $0 \textrm{pt}$, tritt folgender Effekt ein:
+\begin{center}
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+|>{\columncolor[gray]{.8}[0pt]}l|
+>{\color{white}%
+ \columncolor[gray]{.2}[0pt]}l|
+\end{verbatim}
+\end{minipage}
+{\bfseries
+\begin{tabular}{%
+|>{\columncolor[gray]{.8}[0pt]}l|
+ >{\color{white}%
+ \columncolor[gray]{.2}[0pt]}l|
+ }
+ eins & zwei\\
+ drei & vier
+ \end{tabular}}
+ \end{center}
+Der voreingestellte "Uberhang von \slash \textsf{tabcolsep} produziert folgendes Layout:
+\begin{center}
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+|>{\columncolor[gray]{.8}}l|
+>{\color{white}%
+ \columncolor[gray]{.2}}l|
+\end{verbatim}
+\end{minipage}
+ {\bfseries
+ \begin{tabular}{%
+ |>{\columncolor[gray]{.8}}l|
+ >{\color{white}%
+ \columncolor[gray]{.2}}l|
+ }
+ eins & zwei\\
+ drei & vier
+ \end{tabular}}
+\end{center}
+M"oglicherweise bedarf man einer Definition, die zwischen diesen Extrembeispielen liegt.
+Ein Betrag von .5\slash \textsf{tabcolsep} sieht dann so aus:
+
+ \begin{center}
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+|>{\columncolor[gray]{.8}[.5\tabcolsep]}l|
+ >{\color{white}%
+\columncolor[gray]{.2}[.5\tabcolsep]}l|
+\end{verbatim}
+\end{minipage}
+{\bfseries
+\begin{tabular}{%
+ |>{\columncolor[gray]{.8}[.5\tabcolsep]}l|
+ >{\color{white}\columncolor[gray]{.2}[.5\tabcolsep]}l|
+ }
+ eins & zwei\\
+ drei & vier
+ \end{tabular}}
+\end{center}
+
+\textsf{colortbl} sollte mit den meisten anderen Paketen kompatibel sein, die mit der
+Syntax des \textsf{array}-Pakets vereinbar sind. Im Einzelfall arbeitet es mit
+\textsf{longtable} und \textsf{dcolumn}, wie es das folgende Beispiel zeigt:
+\errorcontextlines10
+ \newcolumntype{A}{%
+ >{\color{white}\columncolor{red}[.5\tabcolsep]%
+ \raggedright}%
+ p{2cm}}
+ \newcolumntype{B}{%
+ >{\columncolor{blue}[.5\tabcolsep]%
+ \color{yellow}\raggedright}
+ p{3cm}}
+ \newcolumntype{E}{%
+ >{\large\bfseries
+ \columncolor{cyan}[.5\tabcolsep]}c}
+ \newcolumntype{F}{%
+ >{\color{white}
+ \columncolor{magenta}[.5\tabcolsep]}c}
+ \newcolumntype{G}{%
+ >{\columncolor[gray]{0.8}[.5\tabcolsep][\tabcolsep]}l}
+\newcolumntype{H}{>{\columncolor[gray]{0.8}}l}
+
+
+3.3 so wie im folgenden verbatim-Text zu verwenden ist am besten, aber
+dann besteht die Notwendigkeit die Version vom Juni 1996 von
+\textsf{dcolumn} zu benutzen, dann nehme man hier -1.
+\newcolumntype{C}{%
+ >{\columncolor{yellow}[.5\tabcolsep]}%
+ D{.}{\cdot}{-1}}
+ \newcolumntype{I}{%
+ >{\columncolor[gray]{0.8}[\tabcolsep][.5\tabcolsep]}%
+ D{.}{\cdot}{-1}}
+
+\setlength\minrowclearance{2pt}
+Ehe die Tabelle beginnt, sollte ein kleiner Leerraum eingef"ugt werden:
+
+\slash \textsf{setlength}\slash \textsf{minrowclearance}\{$2\textrm{pt}$\}
+
+\begin{longtable}{ABC}
+\multicolumn{3}{E}{Bsp. f"ur eine lange Tabelle}\\
+\multicolumn{2}{F}{die ersten beiden Spalten}&
+\multicolumn{1}{F}{die dritte Spalte}\\
+\multicolumn{2}{F}{p-type} &
+\multicolumn{1}{F}{D-type (\textsf{dcolumn})}\endfirsthead
+\multicolumn{3}{E}{Bsp. f"ur eine lange Tabelle (Fortsetzung)}\\
+\multicolumn{2}{F}{die ersten beiden Spalten} &
+\multicolumn{1}{F}{die dritte Spalte}\\
+\multicolumn{2}{F}{p-type} &
+\multicolumn{1}{F}{D-type (\textsf{dcolumn})}\endhead
+\multicolumn{3}{E}{Fortsetzung folgt\ldots}\endfoot
+\multicolumn{3}{E}{Ende}\endlastfoot
+P-column & und eine &12.34\\
+\multicolumn{1}{G}{Total}&
+\multicolumn{1}{H}{(falsch)}&
+\multicolumn{1}{I}{100.6}\\
+Ein etwas l"angerer Text in der ersten Spalte & bbb & 1.2\\
+ aaa & und etwas mehr Text in der zweiten Spalte & 1.345\\
+\multicolumn{1}{G}{Total} &
+\multicolumn{1}{H}{(falsch)} &
+\multicolumn{1}{I}{100.6}\\
+aaa & bbb & 1.345\\
+Beachten Sie, dass sich die farbigen Linien der Breite der l"angsten
+Tabelleneintr"age anpassen. & bbb &1.345\\
+aaa & bbb &100\\
+aaa & Abh"angig vom Treiber enstehen dort, wo sich Felder beeinflussen, unansehnliche
+L"ucken oder Linien. Sie k"onnen dann durch die Definition von "Uberhang-Komponenten
+angrenzende Fl"achen derselben Farbe erzeugen oder durch \textsf{noalign} `negative
+Felder'zwischen Zeilen einf"ugen. & 12.4\\
+aaa & bbb & 45.3\\
+\end{longtable}
+
+Dieses Beispiel zeigt ein wenig ansprechendes Layout, ist jedoch farbenfroh gestaltet.
+F"ur den vollst"andigen Quelltext "offnen sie die Quelldatei
+\textsf{colortbl.dtx}. Die
+verwendeten Spalten-Typen finden Sie aber auch hier:
+
+\begin{verbatim}
+\newcolumntype{A}{%
+ >{\color{white}\columncolor{red}[.5\tabcolsep]%
+ \raggedright}%
+ p{2cm}}
+\newcolumntype{B}{%
+ >{\columncolor{blue}[.5\tabcolsep]%
+ \color{yellow}\raggedright}
+ p{3cm}}
+\newcolumntype{C}{%
+ >{\columncolor{yellow}[.5\tabcolsep]}%
+ D{.}{\cdot}{3.3}}
+\newcolumntype{E}{%
+ >{\large\bfseries
+ \columncolor{cyan}[.5\tabcolsep]}c}
+\newcolumntype{F}{%
+ >{\color{white}
+ \columncolor{magenta}[.5\tabcolsep]}c}
+\newcolumntype{G}{%
+ >{\columncolor[gray]{0.8}[.5\tabcolsep][\tabcolsep]}l}
+\newcolumntype{H}{>{\columncolor[gray]{0.8}}l}
+\newcolumntype{I}{%
+ >{\columncolor[gray]{0.8}[\tabcolsep][.5\tabcolsep]}%
+ D{.}{\cdot}{3.3}}
+\end{verbatim}
+
+\section{Benutzung der `"Uberhang'-Argumente f"ur \textsf{tabular*}}
+
+Die bisher aufgef"uhrten Optionen eignen sich f"ur tabular, aber wie sieht es mit
+\textsf{tabular*} aus?
+
+In diesem Fall ist die Gestaltung farbiger Felder schwieriger. Die
+Anwendung des
+\TeX Befehls \slash \textsf{leader}, der zum Einf"ugen breiterer farbiger Felder dient,
+"ahnelt \emph{glue}. \slash \textsf{tabskip} glue, das bei \textsf{tabular*}
+(und in diesem Fall auch bei \textsf{longtable}) zwischen den Spalten eingef"ugt wird,
+muss ein `wirklicher glue-Befehl' sein, keine `leader-Anweisung'.
+
+Mit einigen Einschr"ankungen kann aber auch hier die "Uberhang-Funktion genutzt werden.
+Beachten Sie nachfolgend die erste Beispieltabelle. Mit \textsf{tabular*} kann in der Pr"aambel
+eine Breite von 3\,cm festgelegt werden:
+\begin{center}
+\begin{minipage}{.6\textwidth}
+\begin{verbatim}
+\begin{tabular*}{3cm}{%
+@{\extracolsep{\fill}}
+>{\columncolor[gray]{.8}[0pt][20mm]}l
+>{\columncolor[gray]{.8}[5mm][0pt]}l
+@{}}
+\end{verbatim}
+\end{minipage}
+ {\bfseries
+ \begin{tabular*}{3cm}{%
+ @{\extracolsep{\fill}}
+ >{\columncolor[gray]{.8}[0pt][20mm]}l
+ >{\columncolor[gray]{.8}[5mm][0pt]}l
+ @{}%
+ }
+ eins & zwei\\
+ drei & vier
+\end{tabular*}}
+\end{center}
+
+ Das Feld kann auf 4\,cm verbreitert werden, aber fordern Sie Ihr Gl"uck nicht mit einer
+ weiteren Verbreiterung auf 5\,cm heraus \ldots
+ \begin{center}
+ \bfseries
+ \begin{tabular*}{4cm}{%
+ @{\extracolsep{\fill}}
+>{\columncolor[gray]{.8}[0pt][20mm]}l
+ >{\columncolor[gray]{.8}[5mm][0pt]}l
+ @{}%
+ }
+ eins & zwei\\
+drei & vier
+ \end{tabular*}\hfill
+ \begin{tabular*}{5cm}{%
+ @{\extracolsep{\fill}}
+ >{\columncolor[gray]{.8}[0pt][20mm]}l
+ >{\columncolor[gray]{.8}[5mm][0pt]}l
+ @{}%
+ }
+ eins & zwei\\
+ drei & vier
+ \end{tabular*}
+ \end{center}
+
+\section{Der \slash \textsf{rowcolor}-Befehl}
+
+Wie demonstriert, kann die Farbe von definierten Zeilen einer Tabelle mit Hilfe des
+\slash \textsf{multicolumn}-Befehls ver"andert werden. Besteht Ihre Tabelle hingegen
+prinzipiell aus \emph{rows}, k"onnten Sie dies als unvorteilhaft empfinden. Aus diesem
+Grund wurde der Befehl \slash \textsf{rowcolor} eingef"uhrt\footnote{Zum Teil auf Kosten
+der Komplexit"at von colortbl.}.
+
+\slash \textsf{rowcolor} arbeitet mit den gleichen Argument-Strukturen wie
+\slash \textsf{columncolor}. Der Befehl muss zu \emph{Beginn} der Zeile eingef"ugt werden.
+Spart man die optionalen "Uberhang-Argumente wieder aus, entsprechen diese den Defintionen
+der \slash \textsf{columncolor}-Befehle der entsprechenden Spalte, bzw. der Defintiion
+von\\
+\slash \textsf{tabcolsep} (oder \slash \textsf{arraycolsep} im \textsf{array}-Paket).
+
+Konkurrieren bei einem Tabelleneintrag eine \slash \textsf{columncolor}-Definition aus der
+Tabellen-Pr"aambel und eine \slash \textsf{rowcolor}-Festlegung vom Beginn der jeweiligen
+Zeile miteinander, setzt sich der \slash \textsf{rowcolor}-Befehl durch. Der
+\slash \textsf{multicolumn}-Befehl darf >\{\slash \textsf{rowcolor}\ldots\ enthalten,
+sodass die voreingestellten Farben der betreffenden Zeile und Spalte aufgehoben werden.
+\begin{center}
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+\begin{tabular}{|l|c|}
+ \rowcolor[gray]{.9}
+ eins & zwei\\
+ \rowcolor[gray]{.5}
+ drei & vier
+\end{tabular}
+\end{verbatim}
+\end{minipage}
+ {\bfseries
+ \begin{tabular}{|l|c|}
+ \rowcolor[gray]{.9}
+ eins & zwei\\
+ \rowcolor[gray]{.5}
+ drei & vier
+ \end{tabular}}
+ \end{center}
+
+ \section{Der \slash \textsf{cellcolor} Befehl}
+
+Die Einstellung der Hintergrundfarbe kann auch auf eine einzelne Zelle beschr"ankt werden,
+indem zu Beginn der Befehl \slash \textsf{multicolumn}\{1\}\{>\slash
+\textsf{rowcolor}\ldots, (oder
+\slash \textsf{columncolor}, wenn keine Zeilenfarbe eingestellt ist) eingegeben wird. Hier treten
+jedoch Defizite auf: 1)~Es hindert die Daten in der Zelle, die F"arbung
+auszul"osen; 2)~die Defintionen f"ur die Ausrichtung der Tabelle m"ussen aus dem Tabellenkopf
+kopiert werden und sind anf"allig f"ur Fehlermeldungen, insbesondere bei
+p\{\} Spalten; 3)~die Anweisung \slash \textsf{multicolumn}\{1\} ist unsinnig. Ersatzweise gibt es
+den \slash \textsf{cellcolor}-Befehl, der wie \slash \textsf{columncolor}
+und \slash \textsf{rowcolor} funktioniert, aber beide aufhebt. \slash
+\textsf{cellcolor} kann auf jede einzuf"arbende Tabellenzelle angewendet werden.
+
+\section{Linien einf"arben}
+
+Sie ben"otigen auch farbige Linien?
+
+Das Einf"arben von Linien bedarf keiner speziellen Befehle. Verwenden Sie
+einfach !\{\slash \textsf{color}\{green\}\slash \textsf{vline}\} an Stelle von |. Die Leerstelle
+zwischen || ist im Normalfall wei"s. Um diese farbig zu gestalten, erweitern Sie die
+"Uberhangeinstellung der vorangehenden Spalte (zu \slash \textsf{tabcolsep}
++ \slash \textsf{arrayrulewidth} + \slash \textsf{doublerulesep}). Oder entfernen Sie die glue-Regel
+bzw. ersetzen Sie diese durch eine farbige Linie der erforderten St"arke,
+wie nachfolgend:
+
+\begin{verbatim}
+{\color{green}\vline}
+@{\color{yellow}\vrule width \doublerulesep}
+!{\color{green}\vline}
+\end{verbatim}
+
+Es sollte sich der gleiche Abstand wie bei || ergeben, nur mit entsprechender Farbigkeit.
+
+Allerdings stellt sich das Einf"arben von \slash \textsf{hline} und \slash
+\textsf{cline} als etwas kniffliger heraus. Deshalb wurden extra Befehle eingef"uhrt (die dann auch
+auf vertikale Linien angewendet werden k"onnen).
+
+\section{\slash \textsf{arrayrulecolor}}
+
+\slash \textsf{arrayrulecolor} ben"otigt die gleichen Argumentfestlegungen
+wie \slash \textsf{color}. Es handelt sich um eine globale Deklaration, die alle folgenden
+horizontalen und vertikalen Linien in Tabellen betrifft. Sie kann
+folgenderma"sen definiert werden: Wird au"serhalb einer jeden Tabelle, zu Beginn einer Zeile oder
+als > Definition innerhalb einer Tabellenpr"aambel in der Tabellenmitte eine Regel eingef"ugt, gilt
+diese nur f"ur alle folgenden Linien. Alle vertikalen Linien vor der Regel erhalten diejenige Farbe,
+welche in der Tabellenpr"aambel festgelegt wurde.
+
+\section{\slash \textsf{doublerulesepcolor}}
+Wenn die Linien bunt sind, m"ochten Sie m"oglicherweise die wei"sen L"ucken, die durch || und
+\slash \textsf{hline}\slash \textsf{hline} entstanden sind, auch farbig gestalten.
+\slash \textsf{doublerulesepcolor} funktioniert wie \slash
+\textsf{arrayrulecolor}. Zu beachten ist, dass \textsf{longtable} den Leerraum, der zwischen
+\slash \textsf{hline}\slash \textsf{hline} entsteht, bei einem
+Seitenumbruch beibeh"alt. (\TeX\
+l"oscht diesen Leeraum automatisch, jedoch die gef"arbte Fl"ache, welche
+vorher von \slash \textsf{doublerulesep} genutzt wurde,
+ist im Prinzip eine dritte Linie in einer anderen Farbe als die beiden
+anderen Linien. Linien sind aber hingegen nicht so einfach zu l"oschen.)
+
+\begin{center}
+\setlength\arrayrulewidth{2pt}\arrayrulecolor{blue}
+\setlength\doublerulesep{2pt}\doublerulesepcolor{yellow}
+
+\begin{minipage}{.75\textwidth}
+\begin{verbatim}
+\setlength\arrayrulewidth{2pt}\arrayrulecolor{blue}
+\setlength\doublerulesep{2pt}\doublerulesepcolor{yellow}
+\begin{tabular}{||l||c||}
+ \hline\hline
+ eins & zwei\\
+ drei & vier\\
+ \hline\hline
+\end{tabular}
+\end{verbatim}
+\end{minipage}
+ {\bfseries
+ \begin{tabular}{|l||c||}
+ \hline\hline
+ eins&zwei\\
+ drei&vier\\
+ \hline\hline
+ \end{tabular}}
+ \end{center}
+
+ \section{Mehr Spa"s mit \slash \textsf{hhline}}
+
+Die obigen Befehle arbeiten mit \slash \textsf{hhline} des \textsf{hhline}-Pakets. Wie auch
+immer\\
+\textsf{hhline} geladen wird, es gibt neben diesem Paket noch eine andere M"oglichkeit. Es
+kann >\{\slash \textsf{ldots}\} genutzt werden, um Defintionen hinzuzuf"ugen, welche zu den
+- oder = \textsf{column}-Regel passen. Insbesondere k"onnen \slash
+ \textsf{arrayrulecolor}- oder \slash \textsf{doublerulesepcolor}-Festlegungen erg"anzt werden.
+Viele Stilhandb"ucher warnen davor, innerhalb von Tabellen Regeln
+einzuf"ugen. Ich vermag es nicht, mir
+vorzustellen, was jene Kritiker aus dem folgenden Regenbogen-Beispiel gemacht h"atten:
+
+\begin{center}
+\setlength\arrayrulewidth{5pt}
+\setlength\doublerulesep{5pt}
+ \renewcommand{\arraystretch}{2}
+ \definecolor{orange}{cmyk}{0,0.61,0.87,0}
+ \definecolor{indigo}{cmyk}{0.8,0.9,0,0}
+ \definecolor{violet}{cmyk}{0.6,0.9,0,0}
+ \newcommand\rainbowline[1]{%
+ \hhline{%
+ >{\arrayrulecolor {red}\doublerulesepcolor[rgb]{.3,.3,1}}%
+ |#1:=%
+ >{\arrayrulecolor{orange}\doublerulesepcolor[rgb]{.4,.4,1}}%
+ =%
+ >{\arrayrulecolor{yellow}\doublerulesepcolor[rgb]{.5,.5,1}}%
+ =%
+ >{\arrayrulecolor {green}\doublerulesepcolor[rgb]{.6,.6,1}}%
+ =%
+ >{\arrayrulecolor {blue}\doublerulesepcolor[rgb]{.7,.7,1}}%
+ =%
+ >{\arrayrulecolor{indigo}\doublerulesepcolor[rgb]{.8,.8,1}}%
+ =%
+ >{\arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}}%
+ =:#1|%
+ }}
+ \arrayrulecolor{red}
+ \doublerulesepcolor[rgb]{.3,.3,1}
+ \begin{tabular}{||*7{>{\columncolor[gray]{.9}}c}||}
+ \rainbowline{t}%
+ \arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}
+ Richard&of&York&gave&battle&in&
+ \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{vain}\\
+ \rainbowline{}%
+ 1&2&3&4&5&6&
+ \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{7}\\
+ \rainbowline{b}%
+ \end{tabular}
+ \end{center}
+\begin{verbatim}
+ \newcommand\rainbowline[1]{%
+ \hhline{%
+ >{\arrayrulecolor {red}\doublerulesepcolor[rgb]{.3,.3,1}}%
+ |#1:=%
+ >{\arrayrulecolor{orange}\doublerulesepcolor[rgb]{.4,.4,1}}%
+ =%
+ >{\arrayrulecolor{yellow}\doublerulesepcolor[rgb]{.5,.5,1}}%
+ =%
+ >{\arrayrulecolor {green}\doublerulesepcolor[rgb]{.6,.6,1}}%
+ =%
+ >{\arrayrulecolor {blue}\doublerulesepcolor[rgb]{.7,.7,1}}%
+ =%
+ >{\arrayrulecolor{indigo}\doublerulesepcolor[rgb]{.8,.8,1}}%
+ =%
+ >{\arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}}%
+ =:#1|%
+ }}
+ \arrayrulecolor{red}
+ \doublerulesepcolor[rgb]{.3,.3,1}%
+ \begin{tabular}{||*7{>{\columncolor[gray]{.9}}c}||}
+ \rainbowline{t}%
+ \arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}
+ Richard & of & York & gave &battle & in &
+ \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{vain}\\
+ \rainbowline{}%
+ 1 & 2 & 3 & 4 & 5 & 6 &
+ \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{7}\\
+ \rainbowline{b}%
+\end{tabular}
+\end{verbatim}
+
+\section{Weniger Spa"s mit \slash \textsf{cline}}
+
+Mit \slash \textsf{cline} erzeugte Linien k"onnen durch \slash
+\textsf{arrayrulecolor} eingef"arbt werden. Tritt jedoch in der folgenden Zeile ein Befehl zur
+Erzeugung eines Farbfelds auf, "uberdeckt dieser die Linienf"arbung. Das
+ist ein kleines `Feature' von \slash \textsf{cline}. Wenn Sie colortbl verwenden, sollten Sie
+innerhalb des \slash \textsf{hhline}-Arguments anstelle von \slash
+\textsf{cline} besser den - Linientyp verwenden
+
+\section{Der \slash \textsf{minrowclearance} Befehl}
+
+Weil colortbl jeden Tabelleneintrag verpacken und berechnen muss, um zu ermitteln wie lang die
+Linien gezogen werden m"ussen, dachte ich daran, das \slash
+\textsf{minrowclearance}-Feature zu erg"anzen. Denn manchmal ber"uhren Eintr"age eine
+vorhergehende \slash \textsf{hline} oder den Anfang eines Farbfeldes, das durch dieses Layout
+definiert wurde. Um sicher zu gehen, dass das nicht passiert, sollten
+\slash \textsf{extrarowsep} und \slash \textsf{arraystretch} erg"anzt werden. Dies reguliert den
+Abstand der Linien angemessen. Manchmal m"ochte man aber trotzdem "uber einem gro"sen Eintrag einen
+extra Platzhalter einf"ugen. F"ur einen kleinen Leerraum k"onnen sie den
+Befehl \slash \textsf{minrowclearance} einf"ugen. (Die H"ohe einer Tabellenzeile sollte die H"ohe
+eines Gro"sbuchstabens plus dieses Leerraums aber nicht "uberschreiten, sonst wirkt die
+Tabellenaufteilung unvorteilhaft.)
+
+Donald Arseneaus Paket \textsf{tabls} verwendet einen "ahnlichen \slash
+\textsf{tablinesep}-Befehl. Ich gab meinem Befehl den gleichen Namen, um eine Kompatibilit"at mit
+\textsf{tabls} zu erm"oglichen. Aber \textsf{tabls} ist, wenn man es einbindet, recht schwierig und
+verh"alt sich vermutlich anders. Deshalb verwende ich jetzt einen anderen Namen.
+
+\end{document}
+
diff --git a/macros/latex/contrib/colortbl/colortbl.dtx b/macros/latex/contrib/colortbl/colortbl.dtx
new file mode 100644
index 0000000000..65c4b975b7
--- /dev/null
+++ b/macros/latex/contrib/colortbl/colortbl.dtx
@@ -0,0 +1,1331 @@
+% \iffalse
+%%
+%% Source File: `colortbl.dtx'.
+%% Copyright 1996 1998 1999 2012 2018 David Carlisle
+%%
+%% This file may be distributed under the terms of the LPPL.
+%% See readme for details.
+%%
+%
+%<*dtx>
+ \ProvidesFile{colortbl.dtx}
+%</dtx>
+%<package>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
+%<package>\ProvidesPackage{colortbl}
+%<driver>\ProvidesFile{colortbl.drv}
+% \fi
+% \ProvidesFile{colortbl.dtx}
+ [2018/12/12 v1.0d Color table columns (DPC)]
+%
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage
+% [debugshow]
+ {colortbl}
+\usepackage{dcolumn,longtable,hhline}
+\setlongtables% in case an old copy of longtable is being used.
+\begin{document}
+\DeleteShortVerb{\|}
+\MakeShortVerb{\"}
+\DocInput{colortbl.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{colortbl.dtx}
+% \title{The \textsf{colortbl} package\thanks{This file
+% has version number \fileversion, last
+% revised \filedate.}}
+% \author{David Carlisle}
+% \date{\filedate}
+%
+% \maketitle
+%
+%
+% \begin{abstract}
+% This package implements a flexible mechanism for giving coloured
+% `panels' behind specified columns in a table.
+% This package requires the \textsf{array} and \textsf{color} packages.
+% \end{abstract}
+%
+% \changes{v0.1}{1996/09/20}{First draft}
+% \changes{v0.1a}{1996/09/21}{Started documentation in doc format}
+% \changes{v0.1b}{1996/09/22}
+% {New scheme: redefine \cs{@classz} rather than just
+% simple \cs{newcolumntype} definition.}
+% \changes{v0.1c}{1996/09/24}
+% {Make overhang arguments optional (suggestion of S. Rahtz).}
+% \changes{v0.1d}{1996/10/05}
+% {\cs{rowcolor} added to make S. Rahtz happy.}
+% \changes{v0.1d}{1996/10/05}
+% {Add \cs{hline} \cs{hhline} and \cs{longtable} support
+% to make S. Rahtz even happier.}
+% \changes{v0.1e}{1996/10/06}
+% {Minor cleanup.}
+% \changes{v0.1f}{1996/10/10}
+% {Better \cs{hhline} and support nested constructs}
+% \changes{v0.1f}{1996/10/12}
+% {0.1f, first public version, had a missing percent....}
+% \changes{v0.1i}{1999/03/24}
+% {LPPL}
+% \changes{v0.1j}{2001/02/13}{\cs{cellcolor} (Donald Arseneau)}
+% \changes{v1.0c}{2018/05/02}{Updates to match new array code}
+% \changes{v1.0d}{2018/12/22}{Updates to match even newer array code}
+%
+% \section{Introduction}
+%
+% This package is for colouring tables (i.e., giving coloured panels
+% behind column entries). In that it has many similarities with
+% Timothy Van Zandt's \textsf{colortab} package. The internal
+% implementation is quite different though, also \textsf{colortab}
+% works with the table constructs of other formats besides \LaTeX.
+% This package requires \LaTeX\ (and its \textsf{color} and
+% \textsf{array} packages).
+%
+% First, a standard \textsf{tabular}, for comparison.
+% \begin{center}
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+% \begin{tabular}{|l|c|}
+% one&two\\
+% three&four
+% \end{tabular}
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{|l|c|}
+% one&two\\
+% three&four
+% \end{tabular}}
+% \end{center}
+%
+% \section{ The \cs{columncolor} command}
+%
+% The examples below demonstrate various possibilities of the
+% "\columncolor" command introduced by this package. The vertical rules
+% specified by "|" are kept in all the examples, to make the column
+% positioning clearer, although possibly you would not want coloured
+% panels \emph{and} vertical rules in practice.
+%
+% The package supplies a "\columncolor" command, that should (only) be
+% used in the argument of a ">" column specifier, to add a coloured
+% panel behind the specified column. It can be used in the main
+% `preamble' argument of \textsf{array} or \textsf{tabular}, and also in
+% "\multicolumn" specifiers.
+%
+% The basic format is:\\
+% "\columncolor"\oarg{color model}\marg{colour}
+% \oarg{left overhang}\oarg{right overhang}
+%
+% The first argument (or first two if the optional argument is used)
+% are standard \textsf{color} package arguments, as used by "\color".
+%
+% The last two arguments control how far the panel overlaps past the
+% widest entry in the column.
+% If the \emph{right overhang} argument is omitted then it defaults to
+% \emph{left overhang}. If they are both omitted they default to
+% "\tabcolsep" (in \textsf{tabular}) or "\arraycolsep"
+% (in \textsf{array}).
+%
+% If the overhangs are both set to "0pt" then the effect is:
+% \begin{center}
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+%|>{\columncolor[gray]{.8}[0pt]}l|
+%>{\color{white}%
+% \columncolor[gray]{.2}[0pt]}l|
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{%
+% |>{\columncolor[gray]{.8}[0pt]}l|
+% >{\color{white}%
+% \columncolor[gray]{.2}[0pt]}l|
+% }
+% one&two\\
+% three&four
+% \end{tabular}}
+% \end{center}
+% The default overhang of "\tabcolsep" produces:
+%\begin{center}
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+%|>{\columncolor[gray]{.8}}l|
+%>{\color{white}%
+% \columncolor[gray]{.2}}l|
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{%
+% |>{\columncolor[gray]{.8}}l|
+% >{\color{white}%
+% \columncolor[gray]{.2}}l|
+% }
+% one&two\\
+% three&four
+% \end{tabular}}
+% \end{center}
+% You might want something between these two extremes.
+% A value of ".5\tabcolsep" produces the following effect
+% \begin{center}
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+%|>{\columncolor[gray]{.8}[.5\tabcolsep]}l|
+% >{\color{white}%
+% \columncolor[gray]{.2}[.5\tabcolsep]}l|
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{%
+% |>{\columncolor[gray]{.8}[.5\tabcolsep]}l|
+% >{\color{white}\columncolor[gray]{.2}[.5\tabcolsep]}l|
+% }
+% one&two\\
+% three&four
+% \end{tabular}}
+% \end{center}
+%
+%
+% This package should work with most other packages that are
+% compatible with the \textsf{array} package syntax. In particular it
+% works with \textsf{longtable} and \textsf{dcolumn}
+% as the following example shows.
+%\errorcontextlines10
+% \newcolumntype{A}{%^^A
+% >{\color{white}\columncolor{red}[.5\tabcolsep]%^^A
+% \raggedright}%
+% p{2cm}}
+% \newcolumntype{B}{%^^A
+% >{\columncolor{blue}[.5\tabcolsep]%^^A
+% \color{yellow}\raggedright}
+% p{3cm}}
+% \newcolumntype{E}{%^^A
+% >{\large\bfseries
+% \columncolor{cyan}[.5\tabcolsep]}c}
+% \newcolumntype{F}{%^^A
+% >{\color{white}
+% \columncolor{magenta}[.5\tabcolsep]}c}
+% \newcolumntype{G}{%^^A
+% >{\columncolor[gray]{0.8}[.5\tabcolsep][\tabcolsep]}l}
+% \newcolumntype{H}{>{\columncolor[gray]{0.8}}l}
+%
+%
+%^^A 3.3 (as used in the verbatim text below) is best but
+%^^A needs a June 96 version of dcolumn, so use -1 here.
+% \newcolumntype{C}{%
+% >{\columncolor{yellow}[.5\tabcolsep]}%
+% D{.}{\cdot}{-1}}
+% \newcolumntype{I}{%^^A
+% >{\columncolor[gray]{0.8}[\tabcolsep][.5\tabcolsep]}%^^A
+% D{.}{\cdot}{-1}}
+%
+% \setlength\minrowclearance{2pt}
+% Before starting give a little space: "\setlength\minrowclearance{2pt}"
+%
+% \begin{longtable}{ABC}
+% \multicolumn{3}{E}{A long table example}\\
+% \multicolumn{2}{F}{First two columns}&
+% \multicolumn{1}{F}{Third column}\\
+% \multicolumn{2}{F}{p-type}&
+% \multicolumn{1}{F}{D-type (\textsf{dcolumn})}\endfirsthead
+% \multicolumn{3}{E}{A long table example (continued)}\\
+% \multicolumn{2}{F}{First two columns}&
+% \multicolumn{1}{F}{Third column}\\
+% \multicolumn{2}{F}{p-type}&
+% \multicolumn{1}{F}{D-type (\textsf{dcolumn})}\endhead
+% \multicolumn{3}{E}{Continued\ldots}\endfoot
+% \multicolumn{3}{E}{The End}\endlastfoot
+% P-column&and another one&12.34\\
+% \multicolumn{1}{G}{Total}&
+% \multicolumn{1}{H}{(wrong)}&
+% \multicolumn{1}{I}{100.6}\\
+% Some long text in the first column&bbb&1.2\\
+% aaa&and some long text in the second column&1.345\\
+% \multicolumn{1}{G}{Total}&
+% \multicolumn{1}{H}{(wrong)}&
+% \multicolumn{1}{I}{100.6}\\
+% aaa&bbb&1.345\\
+% Note that the coloured rules in all columns stretch to accomodate
+% large entries in one column. &bbb&1.345\\
+% aaa&bbb&100\\
+% aaa&Depending on your driver you may get unsightly gaps or lines
+% where the `screens' used to produce different shapes interact
+% badly. You may want to cause adjacent panels of the same colour by
+% specifying a larger overhang
+% or by adding some negative space (in a "\noalign" between rows.&12.4\\
+% aaa&bbb&45.3\\
+% \end{longtable}
+%
+% This
+% example shows rather poor taste but is quite colourful!
+% Inspect the source file, "colortbl.dtx", to see the full code for
+% the example, but it uses the following column types.
+%\begin{verbatim}
+% \newcolumntype{A}{%
+% >{\color{white}\columncolor{red}[.5\tabcolsep]%
+% \raggedright}%
+% p{2cm}}
+% \newcolumntype{B}{%
+% >{\columncolor{blue}[.5\tabcolsep]%
+% \color{yellow}\raggedright}
+% p{3cm}}
+% \newcolumntype{C}{%
+% >{\columncolor{yellow}[.5\tabcolsep]}%
+% D{.}{\cdot}{3.3}}
+% \newcolumntype{E}{%
+% >{\large\bfseries
+% \columncolor{cyan}[.5\tabcolsep]}c}
+% \newcolumntype{F}{%
+% >{\color{white}
+% \columncolor{magenta}[.5\tabcolsep]}c}
+% \newcolumntype{G}{%
+% >{\columncolor[gray]{0.8}[.5\tabcolsep][\tabcolsep]}l}
+% \newcolumntype{H}{>{\columncolor[gray]{0.8}}l}
+% \newcolumntype{I}{%
+% >{\columncolor[gray]{0.8}[\tabcolsep][.5\tabcolsep]}%
+% D{.}{\cdot}{3.3}}
+%\end{verbatim}
+%
+% \section{Using the `overhang' arguments for \textsf{tabular*}}
+%
+% The above is all very well for \textsf{tabular}, but what about
+% \textsf{tabular*}?
+%
+% Here the problem is rather harder. Although \TeX's "\leader" mechanism
+% which is used by this package to insert the `stretchy' coloured panels
+% is rather like \emph{glue}, the "\tabskip" glue that is inserted
+% between columns of \textsf{tabular*} (and \textsf{longtable} for that
+% matter) has to be `real glue' and not `leaders'.
+%
+% Within limits the overhang options may be used here. Consider the
+% first table example above. If we use \textsf{tabular*} set to 3\,cm
+% with a preamble setting of
+% \begin{center}
+%\begin{minipage}{.6\textwidth}
+%\begin{verbatim}
+%\begin{tabular*}{3cm}{%
+%@{\extracolsep{\fill}}
+%>{\columncolor[gray]{.8}[0pt][20mm]}l
+%>{\columncolor[gray]{.8}[5mm][0pt]}l
+%@{}}
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular*}{3cm}{%
+% @{\extracolsep{\fill}}
+% >{\columncolor[gray]{.8}[0pt][20mm]}l
+% >{\columncolor[gray]{.8}[5mm][0pt]}l
+% @{}%
+% }
+% one&two\\
+% three&four
+% \end{tabular*}}
+% \end{center}
+%
+% Changing the specified width to 4\,cm works, but don't push your
+% luck to 5\,cm\ldots
+% \begin{center}
+% \bfseries
+% \begin{tabular*}{4cm}{%
+% @{\extracolsep{\fill}}
+% >{\columncolor[gray]{.8}[0pt][20mm]}l
+% >{\columncolor[gray]{.8}[5mm][0pt]}l
+% @{}%
+% }
+% one&two\\
+% three&four
+% \end{tabular*}\hfill
+% \begin{tabular*}{5cm}{%
+% @{\extracolsep{\fill}}
+% >{\columncolor[gray]{.8}[0pt][20mm]}l
+% >{\columncolor[gray]{.8}[5mm][0pt]}l
+% @{}%
+% }
+% one&two\\
+% three&four
+% \end{tabular*}
+% \end{center}
+%
+% \section{The \cs{rowcolor} command}
+%
+% As demonstrated above, one may change the colour of specified rows
+% of a table by the use of "\multicolumn" commands in each entry of
+% the row. However if your table is to be marked principally by
+% \emph{rows}, you may find this rather inconvenient. For this reason
+% a new mechanism, "\rowcolor", has been introduced\footnote{At some
+% cost to the internal complexity of this package}.
+%
+% "\rowcolor" takes the same argument forms as "\columncolor". It must
+% be used at the \emph{start} of a row. If the optional overhang
+% arguments are not used the overhangs will default to the overhangs
+% specified in any "\columncolor" comands for that column, or
+% "\tabcolsep" ("\arraycolsep" in \textsf{array}).
+%
+% If a table entry is in the scope of a "\columncolor" specified in the
+% table preamble, and also a "\rowcolor" at the start of the current
+% row, the colour specified by "\rowcolor" will take effect. A
+% "\multicolumn" command may contain ">{\rowcolor"\ldots\ which will
+% override the default colours for both the current row and column.
+% \begin{center}
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+% \begin{tabular}{|l|c|}
+% \rowcolor[gray]{.9}
+% one&two\\
+% \rowcolor[gray]{.5}
+% three&four
+% \end{tabular}
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{|l|c|}
+% \rowcolor[gray]{.9}
+% one&two\\
+% \rowcolor[gray]{.5}
+% three&four
+% \end{tabular}}
+% \end{center}
+%
+% \section{The \cs{cellcolor} command}
+%
+% A background colour can be applied to a single cell of a table by
+% beginning it with
+% "\multicolumn"\nolinebreak[3]"{1}"\nolinebreak[3]"{>{\rowcolor"\ldots,
+% (or "\columncolor" if no row-colour is in effect) but this has some
+% deficiencies:
+% 1)~It prevents data within the cell from triggering the colouration; \
+% 2)~The alignment specification must be copied from the top of the tabular,
+% which is prone to errors, especially for "p{}" columns; \
+% 3)~"\multicolumn{1}" is just silly. \
+% Therefore, there is the \cs{cellcolor} command, which works like
+% \cs{columncolor} and \cs{rowcolor}, but over-rides both of them;
+% \cs{cellcolor} can be placed anywhere in the tabular cell to which
+% it applies.
+%
+% \section{Colouring rules.}
+%
+% So you want coloured rules as well?
+%
+% One could do vertical rules without any special commands, just use
+% something like "!{\color{green}\vline}" where you'd
+% normally use "|". The space between "||" will normally be left white.
+% If you want to colour that as well, either increase the overhang of
+% the previous column (to
+% "\tabcolsep" + "\arrayrulewidth" + "\doublerulesep")
+% Or remove the inter rule glue, and replace by a coloured rule of the
+% required thickness. So
+%\begin{verbatim}
+%!{\color{green}\vline}
+%@{\color{yellow}\vrule width \doublerulesep}
+%!{\color{green}\vline}
+%\end{verbatim}
+% Should give the same spacing as "||" but more colour.
+%
+% However colouring "\hline" and "\cline" is a bit more tricky, so
+% extra commands are provided (which then apply to vertical rules as
+% well).
+%
+% \section{\cs{arrayrulecolor}}
+% "\arrayrulecolor" takes the same arguments as "\color", and is a
+% global declaration which affects all following horizontal and
+% vertical rules in tables. It may be given outside any table, or at
+% the start of a row, or in a ">" specification in a table preamble.
+% You should note however that if given mid-table it only affects
+% rules that are specified after this point, any vertical rules
+% specified in the preamble will keep their original colours.
+%
+% \section{\cs{doublerulesepcolor}}
+% Having coloured your rules, you'll probably want something other
+% than white to go in the gaps made by "||" or "\hline\hline".
+% "\doublerulesepcolor" works just the same way as "\arrayrulecolor".
+% The main thing to note that if this command is used, then
+% \textsf{longtable} will not `discard' the space between
+% "\hline\hline" at a page break. (\TeX\ has a built-in ability to
+% discard space, but the coloured `space' which is used once
+% "\doublerulesep" is in effect is really a third rule of a different
+% colour to the two outer rules, and rules are rather harder to
+% discard.)
+%
+% \begin{center}
+% \setlength\arrayrulewidth{2pt}\arrayrulecolor{blue}
+% \setlength\doublerulesep{2pt}\doublerulesepcolor{yellow}
+%
+%\begin{minipage}{.75\textwidth}
+%\begin{verbatim}
+%\setlength\arrayrulewidth{2pt}\arrayrulecolor{blue}
+%\setlength\doublerulesep{2pt}\doublerulesepcolor{yellow}
+% \begin{tabular}{||l||c||}
+% \hline\hline
+% one&two\\
+% three&four\\
+% \hline\hline
+% \end{tabular}
+%\end{verbatim}
+%\end{minipage}
+% {\bfseries
+% \begin{tabular}{|l||c||}
+% \hline\hline
+% one&two\\
+% three&four\\
+% \hline\hline
+% \end{tabular}}
+% \end{center}
+%
+% \section{More fun with \cs{hhline}}
+% The above commands work with "\hhline" from the \textsf{hhline}
+% package, however if \textsf{hhline} is loaded in addition to this
+% package, a new possibility is added. You may use ">{"\ldots"}" to add
+% declarations that apply to the following "-" or "=" column rule.
+% In particular you may give "\arrayrulecolor" and
+% "\doublerulesepcolor" declarations in this argument.
+%
+% Most manuals of style warn against over use of rules in tables.
+% I hate to think what they would make of the following rainbow
+% example:
+% \begin{center}
+% \setlength\arrayrulewidth{5pt}
+% \setlength\doublerulesep{5pt}
+% \renewcommand{\arraystretch}{2}
+% \definecolor{orange}{cmyk}{0,0.61,0.87,0}
+% \definecolor{indigo}{cmyk}{0.8,0.9,0,0}
+% \definecolor{violet}{cmyk}{0.6,0.9,0,0}
+% \newcommand\rainbowline[1]{%^^A
+% \hhline{%^^A
+% >{\arrayrulecolor {red}\doublerulesepcolor[rgb]{.3,.3,1}}%^^A
+% |#1:=%^^A
+% >{\arrayrulecolor{orange}\doublerulesepcolor[rgb]{.4,.4,1}}%^^A
+% =%^^A
+% >{\arrayrulecolor{yellow}\doublerulesepcolor[rgb]{.5,.5,1}}%^^A
+% =%^^A
+% >{\arrayrulecolor {green}\doublerulesepcolor[rgb]{.6,.6,1}}%^^A
+% =%^^A
+% >{\arrayrulecolor {blue}\doublerulesepcolor[rgb]{.7,.7,1}}%^^A
+% =%^^A
+% >{\arrayrulecolor{indigo}\doublerulesepcolor[rgb]{.8,.8,1}}%^^A
+% =%^^A
+% >{\arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}}%^^A
+% =:#1|%^^A
+% }}
+% \arrayrulecolor{red}
+% \doublerulesepcolor[rgb]{.3,.3,1}
+% \begin{tabular}{||*7{>{\columncolor[gray]{.9}}c}||}
+% \rainbowline{t}%^^A
+% \arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}
+% Richard&of&York&gave&battle&in&
+% \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{vain}\\
+% \rainbowline{}%^^A
+% 1&2&3&4&5&6&
+% \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{7}\\
+% \rainbowline{b}%^^A
+% \end{tabular}
+% \end{center}
+%\begin{verbatim}
+% \newcommand\rainbowline[1]{%
+% \hhline{%
+% >{\arrayrulecolor {red}\doublerulesepcolor[rgb]{.3,.3,1}}%
+% |#1:=%
+% >{\arrayrulecolor{orange}\doublerulesepcolor[rgb]{.4,.4,1}}%
+% =%
+% >{\arrayrulecolor{yellow}\doublerulesepcolor[rgb]{.5,.5,1}}%
+% =%
+% >{\arrayrulecolor {green}\doublerulesepcolor[rgb]{.6,.6,1}}%
+% =%
+% >{\arrayrulecolor {blue}\doublerulesepcolor[rgb]{.7,.7,1}}%
+% =%
+% >{\arrayrulecolor{indigo}\doublerulesepcolor[rgb]{.8,.8,1}}%
+% =%
+% >{\arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}}%
+% =:#1|%
+% }}
+% \arrayrulecolor{red}
+% \doublerulesepcolor[rgb]{.3,.3,1}%
+% \begin{tabular}{||*7{>{\columncolor[gray]{.9}}c}||}
+% \rainbowline{t}%
+% \arrayrulecolor{violet}\doublerulesepcolor[rgb]{.9,.9,1}
+% Richard&of&York&gave&battle&in&
+% \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{vain}\\
+% \rainbowline{}%
+% 1&2&3&4&5&6&
+% \multicolumn{1}{>{\columncolor[gray]{.9}}c||}{7}\\
+% \rainbowline{b}%
+% \end{tabular}
+%\end{verbatim}
+%
+% \section{Less fun with \cs{cline}}
+% Lines produced by "\cline" are coloured if you use
+% "\arrayrulecolor" but you may not notice as they are covered up by
+% any colour pannels in the following row. This is a `feature' of
+% "\cline". If using this package you would probably better using the
+% "-" rule type in a "\hhline" argument, rather than "\cline".
+%
+% \section{The \cs{minrowclearance} command}
+%
+% As this package has to box and measure every entry to figure out
+% how wide to make the rules, I thought I may as well add the
+% following feature. `Large' entries in tables may touch a preceding
+% "\hline" or the top of a colour panel defined by this style.
+% It is best to increase "\extrarowsep" or "\arraystretch"
+% sufficiently to ensure this doesn't happen, as that will keep the
+% line spacing in the table regular. Sometimes however, you just want
+% to \LaTeX\ to insert a bit of extra space above a large entry.
+% You can set the length "\minrowclearance" to a small value.
+% (The height of a capital letter plus this value should not be
+% greater than the normal height of table rows, else a very uneven
+% table spacing will result.)
+%
+% Donald Arseneau's \textsf{tabls} packages provides a similar
+% "\tablinesep". I was going to give this the same name for
+% compatibility with \textsf{tabls}, but that is implemented quite
+% differently and probably has different behaviour. So I'll keep a new
+% name for now.
+%
+% \StopEventually{}
+%
+% \section{The Code}
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% Nasty hacky way used by all the graphics packages to include debugging
+% code.
+% \begin{macrocode}
+\edef\@tempa{%
+ \noexpand\AtEndOfPackage{%
+ \catcode`\noexpand\^^A\the\catcode`\^^A\relax}}
+\@tempa
+\catcode`\^^A=\catcode`\%
+\DeclareOption{debugshow}{\catcode`\^^A=9 }
+% \end{macrocode}
+%
+% All the other options are handled by the \textsf{color} package.
+% \begin{macrocode}
+\DeclareOption*{\PassOptionsToPackage\CurrentOption{color}}
+\ProcessOptions
+% \end{macrocode}
+%
+% I need these so load them now. Actually Mark Wooding's
+% \textsf{mdwtab} package could probably work instead of \textsf{array},
+% but currently I assume \textsf{array} package internals so\ldots
+% \begin{macrocode}
+\RequirePackage{array,color}
+% \end{macrocode}
+%
+%
+% \begin{macro}{\@classz}
+% First define stub for new \textsf{array} package code.
+% \begin{macrocode}
+\ifx\do@row@strut\@undefined\let\do@row@strut\relax\fi
+% \end{macrocode}
+%
+% "\@classz" is the main function in the \textsf{array} package handling
+% of primitive column types: It inserts the code for each of the column
+% specifiers, `"clrpmb"'. The other classes deal with the other preamble
+% tokens such as `"@" 'or `">"'.
+% \begin{macrocode}
+\def\@classz{\@classx
+ \@tempcnta \count@
+ \prepnext@tok
+% \end{macrocode}
+% At this point the colour specification for the background panel will
+% be in the code for the `">"' specification of this column. This is
+% saved in "\toks\@temptokena" but \textsf{array} will insert it too
+% late (well it would work for "c", but not for "p") so fish the colour
+% stuff out of that token register by hand, and then insert it around
+% the entry.
+%
+% Of course this is a terrible hack. What is really needed is a new
+% column type that inserts stuff in the right place (rather like "!"
+% but without the spacing that that does). The "\newcolumntype"
+% command of \textsf{array} only adds `second class' column types.
+% The re-implementations of "\newcolumntype" in my \textsf{blkarray} or
+% Mark Wooding's \textsf{mdwtab} allow new `first class' column types
+% to be declared, but stick with \textsf{array} for now. This means we
+% have to lift the stuff out of the register before the register gets
+% emptied in the wrong place.
+% \begin{macrocode}
+\expandafter\CT@extract\the\toks\@tempcnta\columncolor!\@nil
+% \end{macrocode}
+% Save the entry into a box (using a double group for colour safety as
+% usual).
+% \begin{macrocode}
+ \@addtopreamble{%
+ \setbox\z@\hbox\bgroup\bgroup
+% \end{macrocode}
+% \changes{v1.0a}{2012/02/13}{reset \cs{everycr} for nested uses (see test ct2)}
+% \begin{macrocode}
+ \CT@everycr{}%
+ \ifcase \@chnum
+% \end{macrocode}
+% "c" code: This used to use twice as much glue as "l" and "r" (1fil
+% on each side). Now modify it to use 1fill total. Also increase the
+% order from 1fil to 1fill to dissuade people from putting stretch glue
+% in table entries.
+% \begin{macrocode}
+ \hskip\stretch{.5}\kern\z@
+ \d@llarbegin
+ \insert@column
+ \d@llarend\do@row@strut\hskip\stretch{.5}\or
+% \end{macrocode}
+% "l" and "r" as before, but using fill glue.
+% \begin{macrocode}
+ \d@llarbegin \insert@column \d@llarend\do@row@strut \hfill \or
+ \hfill\kern\z@ \d@llarbegin \insert@column \d@llarend\do@row@strut \or
+% \end{macrocode}
+% "m", "p" and "b" as before, but need to take account of array package update.
+% \begin{macrocode}
+ \ifx\ar@align@mcell\@undefined
+ $\vcenter
+ \@startpbox{\@nextchar}\insert@column \@endpbox $
+ \else
+ \setbox\ar@mcellbox\vbox
+ \@startpbox{\@nextchar}\insert@column \@endpbox
+ \ar@align@mcell
+ \do@row@strut
+ \fi
+ \or
+ \vtop \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut \or
+ \vbox \@startpbox{\@nextchar}\insert@column \@endpbox\do@row@strut
+ \fi
+% \end{macrocode}
+% Close the box register assignment.
+% \begin{macrocode}
+ \egroup\egroup
+% \end{macrocode}
+% \changes{v0.1d}{1996/10/05}
+% {add \cs{CT@row@color} to support \cs{rowcolor}}
+% The main new stuff.
+% \begin{macrocode}
+\begingroup
+% \end{macrocode}
+% Initalise colour command and overhands.
+% \begin{macrocode}
+ \CT@setup
+% \end{macrocode}
+% Run any code resulting from "\columncolor" commands.
+% \begin{macrocode}
+ \CT@column@color
+% \end{macrocode}
+% Run code from "\rowcolor" (so this takes precedence over
+% "\columncolor").
+% \begin{macrocode}
+ \CT@row@color
+% \end{macrocode}
+% Run code from "\cellcolor" (so this takes precedence over
+% both "\columncolor" and "\rowcolor").
+% \begin{macrocode}
+ \CT@cell@color
+% \end{macrocode}
+% This is "\relax" unless one of the three previous commands has requested
+% a colour, in which case it will be "\CT@@do@color" which will insert
+% "\leaders" of appropriate colour.
+% \begin{macrocode}
+ \CT@do@color
+\endgroup
+% \end{macrocode}
+% Nothing to do with colour this bit, since we are boxing and measuring
+% the entry anyway may as well check the height, so that large entries
+% don't bump into horizontal rules (or the top of the colour panels).
+% \begin{macrocode}
+ \@tempdima\ht\z@
+ \advance\@tempdima\minrowclearance
+ \vrule\@height\@tempdima\@width\z@
+% \end{macrocode}
+% It would be safer to leave this boxed, but unboxing allows some
+% flexibilty. However the total glue stretch should either be finite
+% or fil (which will be ignored). There may be fill glue (which will not
+% be ignored) but it should \emph{total 0fill}. If this box contributes
+% fill glue, then the leaders will not reach the full width of the
+% entry. In the case of "\multicolumn" entries it is actually possible
+% for this box to contribute \emph{shrink} glue, in which case the
+% coloured panel for that entry will be too wide. Tough luck.
+% \begin{macrocode}
+ \unhbox\z@}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \prepnext@tok}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@setup}
+% Initialise the overhang lengths and the colour command.
+% \begin{macrocode}
+\def\CT@setup{%
+ \@tempdimb\col@sep
+ \@tempdimc\col@sep
+ \def\CT@color{%
+ \global\let\CT@do@color\CT@@do@color
+ \color}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@@do@color}
+% The main point of the package: Add the colour panels.
+%
+% Add a leader of the specified colour, with natural width the
+% width of the entry plus the specified overhangs and 1fill stretch.
+% Surround by negative kerns so total natural width is not affected by
+% overhang.
+% \begin{macrocode}
+\def\CT@@do@color{%
+ \global\let\CT@do@color\relax
+ \@tempdima\wd\z@
+ \advance\@tempdima\@tempdimb
+ \advance\@tempdima\@tempdimc
+ \kern-\@tempdimb
+ \leaders\vrule
+% \end{macrocode}
+% For quick debugging with xdvi (which can't do colours). Limit the size
+% of the rule, so I can see the text as well.
+% \begin{macrocode}
+^^A \@height\p@\@depth\p@
+% \end{macrocode}
+%
+% \begin{macrocode}
+ \hskip\@tempdima\@plus 1fill
+ \kern-\@tempdimc
+% \end{macrocode}
+% Now glue to exactly compensate for the leaders.
+% \begin{macrocode}
+ \hskip-\wd\z@ \@plus -1fill }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@extract}
+% Now the code to extract the "\columncolor" commands.
+% \begin{macrocode}
+\def\CT@extract#1\columncolor#2#3\@nil{%
+ \if!#2%
+% \end{macrocode}
+% "!" is a fake token inserted at the end.
+% \begin{macrocode}
+ \let\CT@column@color\@empty
+ \else
+% \end{macrocode}
+% If there was an optional argument
+% \begin{macrocode}
+ \if[#2%
+ \CT@extractb{#1}#3\@nil
+ \else
+% \end{macrocode}
+% No optional argument
+% \begin{macrocode}
+ \def\CT@column@color{%
+ \CT@color{#2}}%
+ \CT@extractd{#1}#3\@nil
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@extractb}
+% Define "\CT@column@color" to add the right colour, and save the
+% overhang lengths. Finally reconstitute the saved `">"' tokens,
+% without the colour specification.
+% First grab the colour spec, with optional arg.
+% \begin{macrocode}
+\def\CT@extractb#1#2]#3{%
+ \def\CT@column@color{%
+ \CT@color[#2]{#3}}%
+ \CT@extractd{#1}}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@extractd}
+% Now look for left-overhang (default to "\col@sep").
+% \begin{macrocode}
+\def\CT@extractd#1{\@testopt{\CT@extracte{#1}}\col@sep}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@extracte}
+% Same for right-overhang (default to left-overhang).
+% \begin{macrocode}
+\def\CT@extracte#1[#2]{\@testopt{\CT@extractf{#1}[#2]}{#2}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@extractf}
+% Add the overhang info to "\CT@do@color", for excuting later.
+% \begin{macrocode}
+\def\CT@extractf#1[#2][#3]#4\columncolor#5\@nil{%
+ \@tempdimb#2\relax
+ \@tempdimc#3\relax
+ \edef\CT@column@color{%
+ \CT@column@color
+ \@tempdimb\the\@tempdimb\@tempdimc\the\@tempdimc\relax}%
+ \toks\@tempcnta{#1#4}}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\CT@everycr}
+% Steal "\everypar" to initialise row colours
+% \begin{macrocode}
+\let\CT@everycr\everycr
+\newtoks\everycr
+\CT@everycr{\noalign{\global\let\CT@row@color\relax}\the\everycr}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@start}
+% \changes{v0.1f}{1996/10/10}
+% {Nested support for \cs{rowcolor} (prompted by Denis Girou)}
+%
+% \begin{macrocode}
+\def\CT@start{%
+ \let\CT@arc@save\CT@arc@
+ \let\CT@drsc@save\CT@drsc@
+ \let\CT@row@color@save\CT@row@color
+ \let\CT@cell@color@save\CT@cell@color
+ \global\let\CT@cell@color\relax}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@end}
+% \begin{macrocode}
+\def\CT@end{%
+ \global\let\CT@arc@\CT@arc@save
+ \global\let\CT@drsc@\CT@drsc@save
+ \global\let\CT@row@color\CT@row@color@save
+ \global\let\CT@cell@color\CT@cell@color@save}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\shortstack}
+% "\shortstack"
+% \begin{macrocode}
+\gdef\@ishortstack#1{%
+ \CT@start\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\CT@end\egroup}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@tabarray}
+% \textsf{array} and \textsf{tabular} (delayed for \textsf{delarray})
+% \begin{macrocode}
+\AtBeginDocument{%
+ \expandafter\def\expandafter\@tabarray\expandafter{%
+ \expandafter\CT@start\@tabarray}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\endarray}
+% \changes{v1.0b}{2012/21/06}{re-insert \cs{@arrayright} to match \textsf{array} definition, for \textsf{delarray}}
+% \begin{macrocode}
+\def\endarray{%
+ \crcr \egroup \egroup \@arrayright\gdef\@preamble{}\CT@end}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\multicolumn}
+% "\multicolumn"
+% \changes{v1.0a}{2012/02/13}{make \cs{multicolumn} long (see test ct1)}
+% \begin{macrocode}
+\long\def\multicolumn#1#2#3{%
+ \multispan{#1}\begingroup
+ \def\@addamp{\if@firstamp \@firstampfalse \else
+ \@preamerr 5\fi}%
+ \@mkpream{#2}\@addtopreamble\@empty
+ \endgroup
+ \def\@sharp{#3}%
+ \let\CT@cell@color\relax
+% \end{macrocode}
+% \changes{v1.0a}{2012/02/13}{don't reset \cs{CT@row@color} (see test ct3)}
+% \let\CT@row@color\relax
+% \begin{macrocode}
+ \let\CT@column@color\relax
+ \let\CT@do@color\relax
+ \@arstrut \@preamble
+ \null
+ \ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\@classvi}
+% Coloured rules and rule separations.
+% \begin{macrocode}
+\def\@classvi{\ifcase \@lastchclass
+ \@acol \or
+ \ifx\CT@drsc@\relax
+ \@addtopreamble{\hskip\doublerulesep}%
+ \else
+ \@addtopreamble{{\CT@drsc@\vrule\@width\doublerulesep}}%
+ \fi\or
+ \@acol \or
+ \@classvii
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doublerulesepcolor}
+% \begin{macrocode}
+\def\doublerulesepcolor#1#{\CT@drs{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@drs}
+% \begin{macrocode}
+\def\CT@drs#1#2{%
+ \ifdim\baselineskip=\z@\noalign\fi
+ {\gdef\CT@drsc@{\color#1{#2}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@drsc@}
+% \begin{macrocode}
+\let\CT@drsc@\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\arrayrulecolor}
+% \begin{macrocode}
+\def\arrayrulecolor#1#{\CT@arc{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@arc}
+% \begin{macrocode}
+\def\CT@arc#1#2{%
+ \ifdim\baselineskip=\z@\noalign\fi
+ {\gdef\CT@arc@{\color#1{#2}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@arc@}
+% \begin{macrocode}
+\let\CT@arc@\relax
+% \end{macrocode}
+% \end{macro}
+%
+% hline
+%
+% \begin{macro}{\@arrayrule}
+% \begin{macrocode}
+\def\@arrayrule{\@addtopreamble {{\CT@arc@\vline}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\hline}
+% \begin{macrocode}
+\def\hline{%
+ \noalign{\ifnum0=`}\fi
+ \let\hskip\vskip
+ \let\vrule\hrule
+ \let\@width\@height
+ {\CT@arc@\vline}%
+ \futurelet
+ \reserved@a\@xhline}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@xhline}
+% \begin{macrocode}
+\def\@xhline{\ifx\reserved@a\hline
+ {\ifx\CT@drsc@\relax
+ \vskip
+ \else
+ \CT@drsc@\hrule\@height
+ \fi
+ \doublerulesep}%
+ \fi
+ \ifnum0=`{\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cline}
+% "\cline" doesn't really work, as it comes behind the coloured panels,
+% but at least make it the right colour (the bits you can see, anyway).
+% \begin{macrocode}
+\def\@cline#1-#2\@nil{%
+ \omit
+ \@multicnt#1%
+ \advance\@multispan\m@ne
+ \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
+ \@multicnt#2%
+ \advance\@multicnt-#1%
+ \advance\@multispan\@ne
+ {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}%
+ \cr
+ \noalign{\vskip-\arrayrulewidth}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\minrowclearance}
+% The row height fudge length.
+% \begin{macrocode}
+\newlength\minrowclearance
+\minrowclearance=0pt
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@mkpream}
+% \begin{macro}{\@mkpreamarray}
+% While expanding the preamble \textsf{array} passes tokens through an
+% "\edef". It doesn't use "\protect"ion as it thinks it has full control
+% at that point. As the redefinition above adds "\color", I need to add
+% that to the list of commands made safe.
+% \begin{macrocode}
+\let\@mkpreamarray\@mkpream
+\def\@mkpream{%
+ \let\CT@setup\relax
+ \let\CT@color\relax
+ \let\CT@do@color\relax
+ \let\color\relax
+ \let\CT@column@color\relax
+ \let\CT@row@color\relax
+ \let\CT@cell@color\relax
+ \@mkpreamarray}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\CT@do@color}
+% For similar reasons, need to make this non-expandable
+% \begin{macrocode}
+\let\CT@do@color\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rowcolor}
+% \changes{v0.1f}{1996/10/10}
+% {Add \cs{noalign} (Denis Girou)}
+% \begin{macrocode}
+\def\rowcolor{%
+ \noalign{\ifnum0=`}\fi
+ \global\let\CT@do@color\CT@@do@color
+ \@ifnextchar[\CT@rowa\CT@rowb}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@rowa}
+% \begin{macrocode}
+\def\CT@rowa[#1]#2{%
+ \gdef\CT@row@color{\CT@color[#1]{#2}}%
+ \CT@rowc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@rowb}
+% \begin{macrocode}
+\def\CT@rowb#1{%
+ \gdef\CT@row@color{\CT@color{#1}}%
+ \CT@rowc}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@rowc}
+% \begin{macrocode}
+\def\CT@rowc{%
+ \@ifnextchar[\CT@rowd{\ifnum`{=0\fi}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@rowd}
+% \begin{macrocode}
+\def\CT@rowd[#1]{\@testopt{\CT@rowe[#1]}{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\CT@rowe}
+% \changes{v0.1h}{1998/05/06}
+% {Fix typo in \cs{ifnum} (Robin F.)}
+% \begin{macrocode}
+\def\CT@rowe[#1][#2]{%
+ \@tempdimb#1%
+ \@tempdimc#2%
+ \xdef\CT@row@color{%
+ \expandafter\noexpand\CT@row@color
+ \@tempdimb\the\@tempdimb
+ \@tempdimc\the\@tempdimc
+ \relax}%
+ \ifnum0=`{\fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\cellcolor}
+% "\cellcolor" applies the specified colour to just its own tabular cell.
+% It is defined robust, but without using "\DeclareRobustCommand" or
+% "\newcommand{}[][]" because those forms are not used elsewhere, and
+% would not work in \emph{very} old \LaTeX.
+% \begin{macrocode}
+\edef\cellcolor{\noexpand\protect
+ \expandafter\noexpand\csname cellcolor \endcsname}
+\@namedef{cellcolor }{%
+ \@ifnextchar[{\CT@cellc\@firstofone}{\CT@cellc\@gobble[]}%
+}
+\def\CT@cellc#1[#2]#3{%
+ \expandafter\gdef\expandafter\CT@cell@color\expandafter{%
+ \expandafter\CT@color#1{[#2]}{#3}%
+ \global\let\CT@cell@color\relax
+}}
+\global\let\CT@cell@color\relax
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\DC@endright}
+% \textsf{dcolumn} support. the "D" column sometimes internally converts
+% a "c" column to an "r" one by squashing the supplied glue. This is bad
+% news for this package, so redefine it to add negative glue to one
+% side and positive to the other to keep the total added zero.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \def\@tempa{$\hfil\egroup\box\z@\box\tw@}%
+ \ifx\@tempa\DC@endright
+% \end{macrocode}
+%
+% New version of \textsf{dcolumn}, only want to fudge it
+% in the "D{.}{.}{3}" case, not the new "D{.}{.}{3.3}" possibility.
+% "\hfill" has already been inserted, so need to remove 1fill's worth
+% of stretch.
+% \begin{macrocode}
+ \def\DC@endright{%
+ $\hfil\egroup
+ \ifx\DC@rl\bgroup
+ \hskip\stretch{-.5}\box\z@\box\tw@\hskip\stretch{-.5}%
+ \else
+ \box\z@\box\tw@
+ \fi}%
+ \else
+ \def\@tempa{$\hfil\egroup\hfill\box\z@\box\tw@}%
+ \ifx\@tempa\DC@endright
+% \end{macrocode}
+%
+% Old \textsf{dcolumn} code.
+% \begin{macrocode}
+ \def\DC@endright{%
+ $\hfil\egroup%
+ \hskip\stretch{.5}\box\z@\box\tw@\hskip\stretch{-.5}}%
+ \fi
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
+% hhline support (almost the whole package, repeated, sigh).
+% \changes{v1.0a}{2012/02/13}{Several improvements (see test ct4)}
+% \begin{macrocode}
+\AtBeginDocument{%
+ \ifx\hhline\@undefined\else
+\def\HH@box#1#2{\vbox{{%
+ \ifx\CT@drsc@\relax\else
+ \global\dimen\thr@@\tw@\arrayrulewidth
+ \global\advance\dimen\thr@@\doublerulesep
+ {\CT@drsc@
+ \hrule \@height\dimen\thr@@
+ \vskip-\dimen\thr@@}%
+ \fi
+ \CT@arc@
+ \hrule \@height \arrayrulewidth \@width #1
+ \vskip\doublerulesep
+ \hrule \@height \arrayrulewidth \@width #2}}}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\HH@loop{%
+ \ifx\@tempb`\def\next##1{\the\toks@\cr}\else\let\next\HH@let
+ \ifx\@tempb|\if@tempswa
+ \ifx\CT@drsc@\relax
+ \HH@add{\hskip\doublerulesep}%
+ \else
+ \HH@add{{\CT@drsc@\vrule\@width\doublerulesep}}%
+ \fi
+ \fi\@tempswatrue
+ \HH@add{{\CT@arc@\vline}}\else
+ \ifx\@tempb:\if@tempswa
+ \ifx\CT@drsc@\relax
+ \HH@add{\hskip\doublerulesep}%
+ \else
+ \HH@add{{\CT@drsc@\vrule\@width\doublerulesep}}%
+ \fi
+ \fi\@tempswatrue
+ \HH@add{\@tempc\HH@box\arrayrulewidth\arrayrulewidth\@tempc}\else
+ \ifx\@tempb##\if@tempswa\HH@add{\hskip\doublerulesep}\fi\@tempswatrue
+ \HH@add{{\CT@arc@\vline\copy\@ne\@tempc\vline}}\else
+ \ifx\@tempb~\@tempswafalse
+ \if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
+ \ifx\CT@drsc@\relax
+ \HH@add{\hfil}\else
+ \HH@add{{%
+ \CT@drsc@\leaders\hrule\@height\HH@height\hfil}}%
+ \fi
+ \else
+ \ifx\@tempb-\@tempswafalse
+ \gdef\HH@height{\arrayrulewidth}%
+ \if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
+ \HH@add{{%
+ \CT@arc@\leaders\hrule\@height\arrayrulewidth\hfil}}%
+ \else
+ \ifx\@tempb=\@tempswafalse
+ \gdef\HH@height{\dimen\thr@@}%
+ \if@firstamp\@firstampfalse\else\HH@add{&\omit}\fi
+ \HH@add
+ {\rlap{\copy\@ne}\leaders\copy\@ne\hfil\llap{\copy\@ne}}\else
+% \end{macrocode}
+% \changes{v0.1f}{1996/10/10}
+% {Remove backspacing for t and b in \cs{hhline}}
+% Stop the backspacing for "t" and "b", it messes up the underlying
+% colour.
+% \begin{macrocode}
+ \ifx\@tempb t\HH@add{%
+ \def\HH@height{\dimen\thr@@}%
+ \HH@box\doublerulesep\z@}\@tempswafalse\else
+ \ifx\@tempb b\HH@add{%
+ \def\HH@height{\dimen\thr@@}%
+ \HH@box\z@\doublerulesep}\@tempswafalse\else
+ \ifx\@tempb>\def\next##1##2{%
+ \HH@add{%
+ {\baselineskip\p@\relax
+ ##2%
+ \global\setbox\@ne\HH@box\doublerulesep\doublerulesep}}%
+ \HH@let!}\else
+ \PackageWarning{hhline}%
+ {\meaning\@tempb\space ignored in \noexpand\hhline argument%
+ \MessageBreak}%
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
+ \next}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\fi}
+% \end{macrocode}
+%
+%
+% longtable support.
+% \begin{macrocode}
+\AtBeginDocument{
+ \ifx\longtable\@undefined\else
+ \def\LT@@hline{%
+ \ifx\LT@next\hline
+ \global\let\LT@next\@gobble
+ \ifx\CT@drsc@\relax
+ \gdef\CT@LT@sep{%
+ \noalign{\penalty-\@medpenalty\vskip\doublerulesep}}%
+ \else
+ \gdef\CT@LT@sep{%
+ \multispan\LT@cols{%
+ \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill}\cr}%
+ \fi
+ \else
+ \global\let\LT@next\empty
+ \gdef\CT@LT@sep{%
+ \noalign{\penalty-\@lowpenalty\vskip-\arrayrulewidth}}%
+ \fi
+ \ifnum0=`{\fi}%
+ \multispan\LT@cols
+ {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ \CT@LT@sep
+ \multispan\LT@cols
+ {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ \noalign{\penalty\@M}%
+ \LT@next}
+ \fi}
+% \end{macrocode}
+%
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \Finale
+%
diff --git a/macros/latex/contrib/colortbl/colortbl.ins b/macros/latex/contrib/colortbl/colortbl.ins
new file mode 100644
index 0000000000..6a2a99c3d0
--- /dev/null
+++ b/macros/latex/contrib/colortbl/colortbl.ins
@@ -0,0 +1,5 @@
+\def\batchfile{colortbl.ins}
+\input docstrip
+\preamble
+\endpreamble
+\generate{\file{colortbl.sty}{\from{colortbl.dtx}{package}}}
diff --git a/macros/latex/contrib/colortbl/colortbl.pdf b/macros/latex/contrib/colortbl/colortbl.pdf
new file mode 100644
index 0000000000..685037c86b
--- /dev/null
+++ b/macros/latex/contrib/colortbl/colortbl.pdf
Binary files differ