diff options
author | Alexander Levin <al.le@rockbox.org> | 2009-08-24 21:22:18 +0000 |
---|---|---|
committer | Alexander Levin <al.le@rockbox.org> | 2009-08-24 21:22:18 +0000 |
commit | fb87e8947340e183e0c9c55345f0f2917d03ef1c (patch) | |
tree | ee59e1119e6eb0b7fb2e7450ea7e567d1c40b138 /manual/preamble.tex | |
parent | 873d266199f02cf619ff0c56f645cb674ed996cf (diff) | |
download | rockbox-fb87e8947340e183e0c9c55345f0f2917d03ef1c.tar.gz rockbox-fb87e8947340e183e0c9c55345f0f2917d03ef1c.zip |
Introduce a new environment 'rbtabular' to make all the tables look the same. See comments in preable.tex. Next step will be to define btnmap and tagmap via this environment.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22503 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'manual/preamble.tex')
-rw-r--r-- | manual/preamble.tex | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/manual/preamble.tex b/manual/preamble.tex index 8bbce066bd..4e2ec7ec79 100644 --- a/manual/preamble.tex +++ b/manual/preamble.tex | |||
@@ -62,7 +62,8 @@ | |||
62 | 62 | ||
63 | % Colors used to typeset table headers and alternating table rows | 63 | % Colors used to typeset table headers and alternating table rows |
64 | \colorlet{tblhdrbgcolor}{gray!60} % Background color for headers | 64 | \colorlet{tblhdrbgcolor}{gray!60} % Background color for headers |
65 | \colorlet{tblrowbgcolor}{gray!30} % Background color for rows | 65 | \colorlet{tbloddrowbgcolor}{white} % Background color for odd rows (headers not included) |
66 | \colorlet{tblevenrowbgcolor}{gray!30} % Background color for even rows (headers not included) | ||
66 | 67 | ||
67 | \usepackage{fancyhdr} | 68 | \usepackage{fancyhdr} |
68 | \usepackage{graphicx} | 69 | \usepackage{graphicx} |
@@ -201,6 +202,43 @@ | |||
201 | \setcounter{totalnumber}{5} % default: 3 | 202 | \setcounter{totalnumber}{5} % default: 3 |
202 | 203 | ||
203 | 204 | ||
205 | % Environment for typesetting tables in a consistent way. The header has | ||
206 | % a darker background; rows are white and light gray (alternating). Top, | ||
207 | % middle and bottom rules are automatically set. | ||
208 | % | ||
209 | % Params: | ||
210 | % #1 -- table width | ||
211 | % #2 -- column specification (as used in the package tabularx) | ||
212 | % #3 -- contents of the header row. The number of items must | ||
213 | % match the number of specs in #2 | ||
214 | % #4 -- caption (optional). If used then this must be inside a floating | ||
215 | % environment, e.g. table | ||
216 | % #5 -- label (optional) | ||
217 | % | ||
218 | % Example: | ||
219 | % \begin{rbtabular}{0.9\textwidth}{lX}{Col1 & Col2}{}{} | ||
220 | % A1 & A2\\ | ||
221 | % B1 & B2\\ | ||
222 | % C1 & C2\\ | ||
223 | % \end{rbtabular} | ||
224 | % | ||
225 | \newenvironment{rbtabular}[5]{% | ||
226 | \rowcolors{2}{tblevenrowbgcolor}{tbloddrowbgcolor} | ||
227 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | ||
228 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | ||
229 | \bottomrule | ||
230 | \SavedEndTab% | ||
231 | \if\given{#4}\caption{#4}\fi% | ||
232 | \if\given{#5}\label{#5}\fi% | ||
233 | \endcenter% | ||
234 | } | ||
235 | \center | ||
236 | \tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor} | ||
237 | #3\\\midrule | ||
238 | }{% | ||
239 | \endtabularx | ||
240 | } | ||
241 | |||
204 | 242 | ||
205 | 243 | ||
206 | 244 | ||
@@ -214,7 +252,7 @@ | |||
214 | % Note: you still need to enclose this with \begin{table} / \end{table} | 252 | % Note: you still need to enclose this with \begin{table} / \end{table} |
215 | % Cheers for the usenet helping me building this up :) | 253 | % Cheers for the usenet helping me building this up :) |
216 | \newenvironment{tagmap}[2]{% | 254 | \newenvironment{tagmap}[2]{% |
217 | \rowcolors{1}{}{tblrowbgcolor} | 255 | \rowcolors{1}{tblevenrowbgcolor}{tbloddrowbgcolor} |
218 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | 256 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname |
219 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | 257 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% |
220 | \bottomrule | 258 | \bottomrule |
@@ -324,7 +362,7 @@ | |||
324 | % Main Unit Key & Remote Key & Description \\ | 362 | % Main Unit Key & Remote Key & Description \\ |
325 | 363 | ||
326 | \newenvironment{btnmap}[2]{% | 364 | \newenvironment{btnmap}[2]{% |
327 | \rowcolors{1}{}{tblrowbgcolor} | 365 | \rowcolors{1}{tblevenrowbgcolor}{tbloddrowbgcolor} |
328 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | 366 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname |
329 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | 367 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% |
330 | \bottomrule | 368 | \bottomrule |