fix the last of the red... note to self, fix backdrop.h!
[kugel-rb.git] / manual / preamble.tex
blob1e3ccce95a26323d5858632ca94eabbefc76373f
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % __________ __ ___.
3 % Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 % Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 % Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 % Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 % \/ \/ \/ \/ \/
8 % - M A N U A L -
10 % $Id$
12 % Copyright (C) 2006 The Rockbox Manual Team
14 % All files in this archive are subject to the GNU Free Documentation License
15 % See the file COPYING-MANUAL in the source tree docs/ directory for full license
16 % agreement.
18 % Contributors are listed in the file docs/CREDITS-MANUAL
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22 \documentclass[a4paper,11pt]{scrreprt}
23 \usepackage[utf8]{inputenc}
24 % This manual used to use Palatino as font. This caused issues with small caps
25 % (textsc), so do not use that font as default one anymore.
27 \usepackage{tabularx}
28 \usepackage{multirow}
29 \usepackage{multicol}
31 \usepackage{float}
32 \floatstyle{ruled}
34 \usepackage{hyperref}
35 \usepackage{enumitem}
37 \usepackage{optional}
39 \usepackage[table]{xcolor}
41 \input{platform/\platform.tex}
42 \input{features.tex}
44 \newcommand{\playername}{\playerman\ \playerlongtype}
46 \hypersetup{% add some values to the pdf properties
47 colorlinks = true,
48 pdfstartview = FitV,
49 linkcolor = blue,
50 citecolor = blue,
51 urlcolor = blue,
52 pdftitle = {Rockbox user manual},
53 pdfauthor = {The Rockbox Team},
54 pdfsubject = {Rockbox user manual for \playername}
57 \newcommand{\fname}[1]{\texttt{#1}}
58 \newcommand{\tabeltc}[1]{{\centering #1 \par}}
59 \newcommand{\tabelth}[1]{{\centering \textbf{\textit{#1}} \par}}
61 \newcommand{\fixme}[1]{\textbf{\textcolor{red}{#1}}}
63 % Colors used to typeset table headers and alternating table rows
64 \colorlet{tblhdrbgcolor}{blue!30} % Background color for headers
65 \colorlet{tbloddrowbgcolor}{blue!10} % Background color for odd rows (headers not included)
66 \colorlet{tblevenrowbgcolor}{white} % Background color for even rows (headers not included)
68 \usepackage{fancyhdr}
69 \usepackage{graphicx}
70 \usepackage{verbatim}
71 \usepackage{makeidx}
72 \usepackage{fancyvrb}
73 \usepackage{color}
74 \ifpdfoutput{\usepackage{booktabs}}%
75 {\newcommand{%
76 \toprule}{}\newcommand{\midrule}{\hline}\newcommand{\bottomrule}{}%
78 \usepackage{longtable}
79 \usepackage{url}
80 \urlstyle{sf}
81 \usepackage{marvosym}
82 \usepackage{ifthen}
83 \usepackage{rotating}
85 % pdf output: try pdf first, then png and jpg as file format
86 % html output: try png first, then jpg. Ignore pdf files
87 % this only applies if no file extension is given!
88 \ifpdfoutput{\DeclareGraphicsExtensions{.pdf,.png,.jpg}}%
89 {\DeclareGraphicsExtensions{.png,.jpg}}
91 % fancy header style adjustments
92 \fancyhead{}
93 \fancyfoot{}
94 \fancyhead[L]{{\nouppercase{\textsc{\leftmark}}}}
95 \fancyhead[R]{\iffloatpage{}{\thepage}}
96 \fancyfoot[L]{\textsc{The Rockbox manual}}
97 \fancyfoot[R]{\textsc{\playerman{} \playertype}}
98 \fancypagestyle{plain}{}
100 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
101 \renewcommand{\footrulewidth}{\iffloatpage{0pt}{0.4pt}}
102 \setlength{\headheight}{18.5pt}
103 \newcounter{example}[chapter]
105 \ifpdfoutput{%
106 \renewcommand{\toprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}}
107 \renewcommand{\midrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
109 \newcommand{\tblhdrstrut}{\rule[-1.3ex]{0mm}{4.0ex}}
112 %% \newenvironment{example}
113 %% {\stepcounter{example}\paragraph{Example \theexample:}}
114 %% {\hfill$\Box$
116 %% \bigskip
117 %% \noindent}
119 % found on the internet, posting by Donald Arseneau
120 % I may as well include my robust expandable definions, which can be
121 % used in \edef or \write where the \def would not be executed:
123 % \if\blank --- checks if parameter is blank (Spaces count as blank)
124 % \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
125 % \if\nil --- checks if parameter is null (spaces are NOT null)
126 % use \if\given{ } ... \else ... \fi etc.
128 {\catcode`\!=8 % funny catcode so ! will be a delimiter
129 \catcode`\Q=3 % funny catcode so Q will be a delimiter
130 \long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
131 \long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
132 \long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
133 \long\gdef\IfN@Ught#1 #2!{\blank{#2}}
134 \long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
137 % environment for setting the changelog.
138 \newenvironment{changelog}%
139 {\renewcommand{\labelitemi}{$\star$}\setitemize{noitemsep,topsep=0pt}%
140 \begin{itemize}}%
141 {\end{itemize}}
144 % add screenshot image.
145 % Usage: \screenshot{filename}{caption}{label}
146 % By using the 'H' (HERE) placement, the screenshots are placed where
147 % we want them.
148 % Note: use this only for screenshots!
149 % Note: leave caption empty to supress it.
150 \newcommand{\screenshot}[3]{
151 \begin{figure}[H]
152 \begin{center}
153 \IfFileExists{#1-\genericimg-\specimg.png}
154 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\specimg.png}
155 \typeout{Note: device specific image used}}
156 {\IfFileExists{#1-\genericimg.png}
157 {\includegraphics[width=\screenshotsize]{#1-\genericimg.png}}
158 {\IfFileExists{#1}
159 {\includegraphics[width=\screenshotsize]{#1}
160 \typeout{Warning: deprecated plain image name used}}%
161 {\typeout{Missing image: #1 (\genericimg) (\specimg)}%
162 \color{red}{\textbf{WARNING!} Image not found}%
166 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
167 \caption{#2}}\fi
168 \end{center}
169 \end{figure}
172 % command to display a note.
173 % Usage: \note{text of your note}
174 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
175 \ifpdfoutput{
176 \newcommand{\note}[1]{
177 \ifinner\else\par\noindent\fi
178 \textbf{Note:}\ %
179 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\fi%
181 {\newcommand{\note}[1]{\ifinner\else\par\noindent\fi\textbf{Note:{} }#1\par}}
183 % command to display a warning.
184 % Usage: \warn{text of your warning}
185 % Note: do NOT use \textbf or similar to emphasize text!
186 \ifpdfoutput{
187 \newcommand{\warn}[1]{
188 \ifinner\else\par\noindent\fi
189 \textbf{Warning:\ }%
190 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%
192 {\newcommand{\warn}[1]{\ifinner\else\par\noindent\fi\textbf{Warning:{} }#1}}
194 % command to mark a text block as intended especially for blind people
195 % Usage: \blind{text}
196 \ifpdfoutput{
197 \newcommand{\blind}[1]{
198 \ifinner\else\par\noindent\fi
199 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\ForwardToEnd}}#1\par\fi%
201 {\newcommand{\blind}[1]{\ifinner\else\par\noindent\fi#1}}
203 % make table floats use "H" (as for screenshots) as default positioning
204 \makeatletter\renewcommand{\fps@table}{H}\makeatother
205 % change defaults for floats on a page as we have a lot of small images
206 \setcounter{topnumber}{3} % default: 2
207 \setcounter{bottomnumber}{2} % default: 1
208 \setcounter{totalnumber}{5} % default: 3
211 % Environment for typesetting tables in a consistent way. The header has
212 % a darker background; rows are white and light gray (alternating). Top,
213 % middle and bottom rules are automatically set.
215 % Params:
216 % #1 -- table width
217 % #2 -- column specification (as used in the package tabularx)
218 % #3 -- contents of the header row. The number of items must
219 % match the number of specs in #2
220 % #4 -- caption (optional). If used then this must be inside a floating
221 % environment, e.g. table
222 % #5 -- label (optional)
224 % Example:
225 % \begin{rbtabular}{0.9\textwidth}{lX}{Col1 & Col2}{}{}
226 % A1 & A2\\
227 % B1 & B2\\
228 % C1 & C2\\
229 % \end{rbtabular}
231 \newenvironment{rbtabular}[5]{%
232 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
233 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
234 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
235 \bottomrule
236 \SavedEndTab%
237 \if\given{#4}\caption{#4}\fi%
238 \if\given{#5}\label{#5}\fi%
239 \endcenter%
241 \center
242 \tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor}
243 \tblhdrstrut#3\\\midrule
245 \endtabularx
251 % command to set the default table heading for button lists
252 \newcommand{\taghead}{\tblhdrstrut\textbf{Tag} & \textbf{Description} \\\midrule}
254 % environment intended to be used with tag maps (for wps)
255 % usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{tagmap}
256 % Note: this automatically sets the table lines.
257 % Note: you *need* to terminate the last line with a linebreak \\
258 % Note: you still need to enclose this with \begin{table} / \end{table}
259 % Cheers for the usenet helping me building this up :)
260 \newenvironment{tagmap}[2]{%
261 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
262 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
263 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
264 \bottomrule
265 \SavedEndTab%
266 \if\given{#1}\caption{#1}\fi%
267 \if\given{#2}\label{#2}\fi%
268 \endcenter%
270 \center
271 \tabularx{\textwidth}{lX}\toprule\rowcolor{tblhdrbgcolor} % here is the table width defined
272 \taghead
274 \endtabularx
277 % When creating HTML, use the soul package.
278 % This produces much nicer HTML code (textsc results in each character being
279 % put in a separate <span>).
280 \ifpdfoutput{\newcommand{\caps}[1]{\textsc{#1}}}{\usepackage{soul}}
281 \newcommand{\setting}[1]{\caps{#1}}
283 \newcommand{\config}[1]{\texttt{#1}}
285 % set link to download server
286 % Usage: \download{bootloader/bootloader-ipodnano.ipod}
287 % gets expanded to
288 % "http://download.rockbox.org/bootloader/bootloader-ipodnano.ipod"
289 \newcommand{\download}[1]{\url{http://download.rockbox.org/#1}}
291 % set link to the wiki.
292 % Usage: \wikilink{WebHome}
293 % with "WebHome" being the wiki page name
294 \newcommand{\wikibaseurl}{http://www.rockbox.org/wiki/}
295 \ifpdfoutput{\newcommand{\wikiicon}{\Pointinghand}}
296 {\newcommand{\wikiicon}{}}
297 \newcommand{\wikilink}[1]{\wikiicon{}\href{\wikibaseurl#1}{#1}}
298 %\newcommand{\wikilink}[1]{\url{http://www.rockbox.org/wiki/#1}}
300 % define environment "code" based on fancyvrb.
301 % use it to set code the user should type / see on his screen.
302 % Note: the first 4 characters of each line will be stripped,
303 % requiring everything to be indendet by exactly _4_ spaces!
304 % This is intended to make the LaTeX sources more readable.
305 % Note: when using the code environment you need to use optv instead of opt!
306 \DefineVerbatimEnvironment{code}{Verbatim}%
307 {framerule=0.4pt, framesep=1ex,frame=lines,%numbers=left,stepnumber=5,%
308 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
309 label=\textnormal{\textsc{Code}},%
310 commandchars=\\\{\}%
313 % define environment "example" based on fancyvrb.
314 % use it to set example code the user should type / see on his screen.
315 % Note: the first 4 characters of each line will be stripped,
316 % requiring everything to be indendet by exactly _4_ spaces!
317 % This is intended to make the LaTeX sources more readable.
318 % Note: when using the example environment you need to use optv instead of opt!
319 \DefineVerbatimEnvironment{example}{Verbatim}%
320 {commentchar=!,framerule=0.4pt, framesep=1ex,frame=lines,%
321 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
322 label=\textnormal{\textsc{Example}},%
323 commandchars=\\\{\}%
326 % Use the nopt command to exclude a certain defined feature from a sectio
327 % Example:
328 % \nopt{ondio}{This text will be excluded for ondios}
329 \newcommand{\optnvalue}{0}
330 \newcommand{\nopt}[2]{%
331 \renewcommand{\optnvalue}{0}\opt{#1}{\renewcommand{\optnvalue}{1}}%
332 \ifthenelse{\optnvalue > 0}{}{#2}%
335 % Use the reference to handle get a flexible reference command
336 % usage \reference{ref_section}
337 \ifpdfoutput{%
338 \newcommand{\reference}[1]{%
339 section~\ref{#1} (page~\pageref{#1})%
341 {\newcommand{\reference}[1]{section~\ref{#1}}}
343 % special HTML output adjustments
344 \ifpdfoutput{}{\setlength{\parindent}{0mm}}
345 \ifpdfoutput{}{\renewcommand{\Forward}[1]{$\triangleright${}#1}}
347 \newcommand{\btnfnt}[1]{\textbf{#1}}
348 %\hfuzz=2pt
350 % generate index
351 \usepackage{makeidx}
352 \makeindex
355 % command to set the default table heading for button lists
356 \newcommand{\btnhead}{\textbf{Key} \opt{HAVEREMOTEKEYMAP}{%
357 & \textbf{Remote Key}} & \textbf{Action} \\\midrule}
358 % environment intended to be used with button maps
359 % usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
360 % Note: this automatically sets the table lines.
361 % Note: you *need* to terminate the last line with a linebreak \\
362 % Note: you still need to enclose this with \begin{table} / \end{table}
363 % Cheers for the usenet helping me building this up :)
365 % tabularx is set to be either two or three columns wide depending on whether
366 % HAVEREMOTEKEYMAP is defined in the platform file for the target in question.
367 % If it is, then every button table has three columns of the form
368 % Main Unit Key & Remote Key & Description \\
370 \newenvironment{btnmap}[2]{%
371 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
372 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
373 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
374 \bottomrule
375 \SavedEndTab%
376 \if\given{#1}\caption{#1}\fi%
377 \if\given{#2}\label{#2}\fi%
378 \endcenter%
380 \center
381 \opt{HAVEREMOTEKEYMAP}{
382 % here is the table width defined for 3 columns
383 \tabularx{.95\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
385 \nopt{HAVEREMOTEKEYMAP}{
386 % here is the table width defined for 2 columns
387 \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
389 \tblhdrstrut\btnhead
391 \endtabularx