1
0
Fork 0
forked from len0rd/rockbox

Manual: do filling the table headers with colors in a more official way, so that the spaces defined in booktabs are retained

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22516 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Alexander Levin 2009-08-26 20:58:49 +00:00
parent a0341df6d5
commit 9f64794c70

View file

@ -65,6 +65,20 @@
\colorlet{tbloddrowbgcolor}{blue!10} % Background color for odd rows (headers not included)
\colorlet{tblevenrowbgcolor}{white} % Background color for even rows (headers not included)
% We use or own rules to typeset tables since we want the headers to
% be fully filled with colors
\newcommand{\rbtoprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}%
\arrayrulecolor{tblhdrbgcolor}\specialrule{\belowrulesep}{0pt}{0pt}%
\arrayrulecolor{black}}
\newcommand{\rbmidrule}{\arrayrulecolor{tblhdrbgcolor}\specialrule{\aboverulesep}{0pt}{0pt}%
\arrayrulecolor{black}\specialrule{\lightrulewidth}{0pt}{0pt}%
\arrayrulecolor{tblevenrowbgcolor}\specialrule{\belowrulesep}{0pt}{0pt}%
\arrayrulecolor{black}}
\newcommand{\rbbottomrule}{\specialrule{\heavyrulewidth}{\aboverulesep}{0pt}%
\arrayrulecolor{white}\specialrule{\belowbottomsep}{0pt}{0pt}%
\arrayrulecolor{black}}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{verbatim}
@ -102,9 +116,6 @@
\setlength{\headheight}{18.5pt}
\newcounter{example}[chapter]
\setlength{\belowrulesep}{0pt}
\setlength{\aboverulesep}{0pt}
%% \newenvironment{example}
%% {\stepcounter{example}\paragraph{Example \theexample:}}
%% {\hfill$\Box$
@ -228,15 +239,15 @@
\rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
\expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
\expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
\bottomrule
\rbbottomrule%
\SavedEndTab%
\if\given{#4}\caption{#4}\fi%
\if\given{#5}\label{#5}\fi%
\endcenter%
}
\center
\tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor}
\rule{0pt}{2.9ex}#3\\\midrule
\tabularx{#1}{#2}\rbtoprule\rowcolor{tblhdrbgcolor}
#3\\\rbmidrule
}{%
\endtabularx
}
@ -245,7 +256,7 @@
% command to set the default table heading for button lists
\newcommand{\taghead}{\rule{0pt}{2.9ex}\textbf{Tag} & \textbf{Description} \\\midrule}
\newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\rbmidrule}
% environment intended to be used with tag maps (for wps)
% usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{tagmap}
@ -257,14 +268,14 @@
\rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
\expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
\expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
\bottomrule
\rbbottomrule%
\SavedEndTab%
\if\given{#1}\caption{#1}\fi%
\if\given{#2}\label{#2}\fi%
\endcenter%
}
\center
\tabularx{\textwidth}{lX}\toprule\rowcolor{tblhdrbgcolor} % here is the table width defined
\tabularx{\textwidth}{lX}\rbtoprule\rowcolor{tblhdrbgcolor} % here is the table width defined
\taghead
}{%
\endtabularx
@ -347,10 +358,9 @@
\usepackage{makeidx}
\makeindex
% command to set the default table heading for button lists
\newcommand{\btnhead}{\textbf{Key} \opt{HAVEREMOTEKEYMAP}{%
& \textbf{Remote Key}} & \textbf{Action} \\\midrule}
& \textbf{Remote Key}} & \textbf{Action} \\\rbmidrule}
% environment intended to be used with button maps
% usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
% Note: this automatically sets the table lines.
@ -367,7 +377,7 @@
\rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
\expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
\expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
\bottomrule
\rbbottomrule%
\SavedEndTab%
\if\given{#1}\caption{#1}\fi%
\if\given{#2}\label{#2}\fi%
@ -376,13 +386,13 @@
\center
\opt{HAVEREMOTEKEYMAP}{
% here is the table width defined for 3 columns
\tabularx{.95\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
\tabularx{.95\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\rbtoprule\rowcolor{tblhdrbgcolor}
}
\nopt{HAVEREMOTEKEYMAP}{
% here is the table width defined for 2 columns
\tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
\tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\rbtoprule\rowcolor{tblhdrbgcolor}
}
\rule{0pt}{2.9ex}\btnhead
\btnhead
}{%
\endtabularx
}