From 931ff0b12c9e6d7fe756c9b8f9891f2227686a30 Mon Sep 17 00:00:00 2001 From: Alex Parker Date: Sat, 20 Jun 2009 22:00:47 +0000 Subject: Much cleaner version of r21411 - add three column button tables capability to the manual. To use, add remote_keymap to the platform file, then button tables can be used in the form Main Button & Remote Button & Description. If remote_keymap is defined in the platform file but additional buttons are not added to the button tables, then the decription will appear in the remote key column, but the manual should still build. Thanks to bluebrother for pointing out! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21423 a1c6a512-1295-4272-9138-f99709370657 --- manual/preamble.tex | 42 +++++++++++------------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/manual/preamble.tex b/manual/preamble.tex index d54a81f16f..024c1010f0 100644 --- a/manual/preamble.tex +++ b/manual/preamble.tex @@ -311,50 +311,30 @@ % 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 +% tabularx is set to be either two or three columns wide depending on whether % remote_keymap 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 +% If it is, then every button table has 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]{% +\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}\caption{#2}\fi% - \if\given{#3}\label{#3}\fi% + \if\given{#2}\label{#2}\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% + \opt{remote_keymap}{ + % here is the table width defined for 3 columns + \tabularx{.9\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule + } + \nopt{remote_keymap}{ + % here is the table width defined for 2 columns + \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule } - \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 -- cgit v1.2.3