summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Parker <rockbox@aeparker.com>2009-06-20 19:17:06 +0000
committerAlex Parker <rockbox@aeparker.com>2009-06-20 19:17:06 +0000
commit60c047405034d51359bdfbaac56bfa97ec06a352 (patch)
tree6cd0a2387813571e214fce89e540088a128e8749
parentb76faecd60ddb414c442db0636c68a24b7c8c045 (diff)
downloadrockbox-60c047405034d51359bdfbaac56bfa97ec06a352.zip
rockbox-60c047405034d51359bdfbaac56bfa97ec06a352.tar.gz
rockbox-60c047405034d51359bdfbaac56bfa97ec06a352.tar.bz2
rockbox-60c047405034d51359bdfbaac56bfa97ec06a352.tar.xz
Prepare the manual to have two or three column button map tables so that remote keymaps can be added.
btnmap is set to be either two or three columns wide depending on whether remote_kaymap is defined in the platform file for the target in question. If it is, then every button table needs to have three columns of the form Main Unit Key & Remote Key & Description \\ or the manual will fail to build. For some reason, it doesn't seem possible to put the \end{btnmap} in a macro, so leave it as it is in the keymaps. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21411 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--manual/preamble.tex84
1 files changed, 61 insertions, 23 deletions
diff --git a/manual/preamble.tex b/manual/preamble.tex
index 07a13fa..0e22b1c 100644
--- a/manual/preamble.tex
+++ b/manual/preamble.tex
@@ -194,30 +194,9 @@
\setcounter{bottomnumber}{2} % default: 1
\setcounter{totalnumber}{5} % default: 3
-% command to set the default table heading for button lists
-\newcommand{\btnhead}{\textbf{Key} & \textbf{Action} \\\midrule}
-% environment intended to be used with button maps
-% usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
-% Note: this automatically sets the table lines.
-% Note: you *need* to terminate the last line with a linebreak \\
-% Note: you still need to enclose this with \begin{table} / \end{table}
-% Cheers for the usenet helping me building this up :)
-\newenvironment{btnmap}[2]{%
- \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
- \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
- \bottomrule
- \SavedEndTab%
- \if\given{#1}\caption{#1}\fi%
- \if\given{#2}\label{#2}\fi%
- \endcenter%
- }
- \center
-\tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule % here is the table width defined
- \btnhead
-}{%
- \endtabularx
-}
+
+
% command to set the default table heading for button lists
\newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\midrule}
@@ -320,3 +299,62 @@
% generate index
\usepackage{makeidx}
\makeindex
+
+
+% command to set the default table heading for button lists
+\newcommand{\btnhead}{\textbf{Key} \opt{remote_keymap}{%
+ & \textbf{Remote Key}} & \textbf{Action} \\\midrule}
+% environment intended to be used with button maps
+% usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
+% Note: this automatically sets the table lines.
+% Note: you *need* to terminate the last line with a linebreak \\
+% Note: you still need to enclose this with \begin{table} / \end{table}
+% Cheers for the usenet helping me building this up :)
+
+% btnmap is set to be either two or three columns wide depending on whether
+% remote_kaymap is defined in the platform file for the target in question.
+% If it is, then every button table needs to have three columns of the form
+% Main Unit Key & Remote Key & Description \\
+% or the manual will fail to build. For some reason, it doesn't seem possible
+% to put the \end{btnmap} in a macro, so leave it as it is in the keymaps.
+
+\opt{remote_keymap}{
+\newenvironment{btnmap}[3]{%
+ \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
+ \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
+ \bottomrule
+ \SavedEndTab%
+ \if\given{#1}\caption{#1}\fi%
+ \if\given{#2}\caption{#2}\fi%
+ \if\given{#3}\label{#3}\fi%
+ \endcenter%
+ }
+ \center
+ \tabularx{.9\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}X>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule % here is the table width defined
+ \btnhead
+}{%
+ \endtabularx
+}
+\newcommand{\beginbuttonmap}{\begin{btnmap}{}{}{}}
+}
+
+\nopt{remote_keymap}{
+\newenvironment{btnmap}[2]{%
+ \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
+ \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
+ \bottomrule
+ \SavedEndTab%
+ \if\given{#1}\caption{#1}\fi%
+ \if\given{#2}\label{#2}\fi%
+ \endcenter%
+ }
+ \center
+ \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule % here is the table width defined
+ \btnhead
+}{%
+ \endtabularx
+}
+\newcommand{\beginbuttonmap}{\begin{btnmap}{}{}}
+}
+
+%\newcommand{\closebuttonmap}{\end{btnmap}} \ No newline at end of file