diff options
-rw-r--r-- | manual/preamble.tex | 84 |
1 files changed, 61 insertions, 23 deletions
diff --git a/manual/preamble.tex b/manual/preamble.tex index 07a13fa392..0e22b1c8bb 100644 --- a/manual/preamble.tex +++ b/manual/preamble.tex | |||
@@ -194,30 +194,9 @@ | |||
194 | \setcounter{bottomnumber}{2} % default: 1 | 194 | \setcounter{bottomnumber}{2} % default: 1 |
195 | \setcounter{totalnumber}{5} % default: 3 | 195 | \setcounter{totalnumber}{5} % default: 3 |
196 | 196 | ||
197 | % command to set the default table heading for button lists | ||
198 | \newcommand{\btnhead}{\textbf{Key} & \textbf{Action} \\\midrule} | ||
199 | 197 | ||
200 | % environment intended to be used with button maps | 198 | |
201 | % usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap} | 199 | |
202 | % Note: this automatically sets the table lines. | ||
203 | % Note: you *need* to terminate the last line with a linebreak \\ | ||
204 | % Note: you still need to enclose this with \begin{table} / \end{table} | ||
205 | % Cheers for the usenet helping me building this up :) | ||
206 | \newenvironment{btnmap}[2]{% | ||
207 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | ||
208 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | ||
209 | \bottomrule | ||
210 | \SavedEndTab% | ||
211 | \if\given{#1}\caption{#1}\fi% | ||
212 | \if\given{#2}\label{#2}\fi% | ||
213 | \endcenter% | ||
214 | } | ||
215 | \center | ||
216 | \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule % here is the table width defined | ||
217 | \btnhead | ||
218 | }{% | ||
219 | \endtabularx | ||
220 | } | ||
221 | 200 | ||
222 | % command to set the default table heading for button lists | 201 | % command to set the default table heading for button lists |
223 | \newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\midrule} | 202 | \newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\midrule} |
@@ -320,3 +299,62 @@ | |||
320 | % generate index | 299 | % generate index |
321 | \usepackage{makeidx} | 300 | \usepackage{makeidx} |
322 | \makeindex | 301 | \makeindex |
302 | |||
303 | |||
304 | % command to set the default table heading for button lists | ||
305 | \newcommand{\btnhead}{\textbf{Key} \opt{remote_keymap}{% | ||
306 | & \textbf{Remote Key}} & \textbf{Action} \\\midrule} | ||
307 | % environment intended to be used with button maps | ||
308 | % usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap} | ||
309 | % Note: this automatically sets the table lines. | ||
310 | % Note: you *need* to terminate the last line with a linebreak \\ | ||
311 | % Note: you still need to enclose this with \begin{table} / \end{table} | ||
312 | % Cheers for the usenet helping me building this up :) | ||
313 | |||
314 | % btnmap is set to be either two or three columns wide depending on whether | ||
315 | % remote_kaymap is defined in the platform file for the target in question. | ||
316 | % If it is, then every button table needs to have three columns of the form | ||
317 | % Main Unit Key & Remote Key & Description \\ | ||
318 | % or the manual will fail to build. For some reason, it doesn't seem possible | ||
319 | % to put the \end{btnmap} in a macro, so leave it as it is in the keymaps. | ||
320 | |||
321 | \opt{remote_keymap}{ | ||
322 | \newenvironment{btnmap}[3]{% | ||
323 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | ||
324 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | ||
325 | \bottomrule | ||
326 | \SavedEndTab% | ||
327 | \if\given{#1}\caption{#1}\fi% | ||
328 | \if\given{#2}\caption{#2}\fi% | ||
329 | \if\given{#3}\label{#3}\fi% | ||
330 | \endcenter% | ||
331 | } | ||
332 | \center | ||
333 | \tabularx{.9\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}X>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule % here is the table width defined | ||
334 | \btnhead | ||
335 | }{% | ||
336 | \endtabularx | ||
337 | } | ||
338 | \newcommand{\beginbuttonmap}{\begin{btnmap}{}{}{}} | ||
339 | } | ||
340 | |||
341 | \nopt{remote_keymap}{ | ||
342 | \newenvironment{btnmap}[2]{% | ||
343 | \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname | ||
344 | \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{% | ||
345 | \bottomrule | ||
346 | \SavedEndTab% | ||
347 | \if\given{#1}\caption{#1}\fi% | ||
348 | \if\given{#2}\label{#2}\fi% | ||
349 | \endcenter% | ||
350 | } | ||
351 | \center | ||
352 | \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule % here is the table width defined | ||
353 | \btnhead | ||
354 | }{% | ||
355 | \endtabularx | ||
356 | } | ||
357 | \newcommand{\beginbuttonmap}{\begin{btnmap}{}{}} | ||
358 | } | ||
359 | |||
360 | %\newcommand{\closebuttonmap}{\end{btnmap}} \ No newline at end of file | ||