fix red, but this might not be the best long term solution.
[kugel-rb.git] / manual / preamble.tex
blob9223fee4065c5a70f3ed5ca5f0b176eb67f0a5f2
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{rotating}
84 % pdf output: try pdf first, then png and jpg as file format
85 % html output: try png first, then jpg. Ignore pdf files
86 % this only applies if no file extension is given!
87 \ifpdfoutput{\DeclareGraphicsExtensions{.pdf,.png,.jpg}}%
88 {\DeclareGraphicsExtensions{.png,.jpg}}
90 % fancy header style adjustments
91 \fancyhead{}
92 \fancyfoot{}
93 \fancyhead[L]{{\nouppercase{\textsc{\leftmark}}}}
94 \fancyhead[R]{\iffloatpage{}{\thepage}}
95 \fancyfoot[L]{\textsc{The Rockbox manual}}
96 \fancyfoot[R]{\textsc{\playerman{} \playertype}}
97 \fancypagestyle{plain}{}
99 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
100 \renewcommand{\footrulewidth}{\iffloatpage{0pt}{0.4pt}}
101 \setlength{\headheight}{18.5pt}
102 \newcounter{example}[chapter]
104 \ifpdfoutput{%
105 \renewcommand{\toprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}}
106 \renewcommand{\midrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
108 \newcommand{\tblhdrstrut}{\rule[-1.3ex]{0mm}{4.0ex}}
111 %% \newenvironment{example}
112 %% {\stepcounter{example}\paragraph{Example \theexample:}}
113 %% {\hfill$\Box$
115 %% \bigskip
116 %% \noindent}
118 % found on the internet, posting by Donald Arseneau
119 % I may as well include my robust expandable definions, which can be
120 % used in \edef or \write where the \def would not be executed:
122 % \if\blank --- checks if parameter is blank (Spaces count as blank)
123 % \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
124 % \if\nil --- checks if parameter is null (spaces are NOT null)
125 % use \if\given{ } ... \else ... \fi etc.
127 {\catcode`\!=8 % funny catcode so ! will be a delimiter
128 \catcode`\Q=3 % funny catcode so Q will be a delimiter
129 \long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
130 \long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
131 \long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
132 \long\gdef\IfN@Ught#1 #2!{\blank{#2}}
133 \long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
136 % environment for setting the changelog.
137 \newenvironment{changelog}%
138 {\renewcommand{\labelitemi}{$\star$}\setitemize{noitemsep,topsep=0pt}%
139 \begin{itemize}}%
140 {\end{itemize}}
143 \newcommand{\dapdisplaysize}{\dapdisplaywidth$\times$\dapdisplayheight$\times$\dapdisplaydepth}
144 \newcommand{\genericimg}{\dapdisplaywidth x\dapdisplayheight x\dapdisplaydepth}
146 % add screenshot image.
147 % Usage: \screenshot{filename}{caption}{label}
148 % By using the 'H' (HERE) placement, the screenshots are placed where
149 % we want them.
150 % Note: use this only for screenshots!
151 % Note: leave caption empty to supress it.
152 \newcommand{\screenshot}[3]{
153 \begin{figure}[H]
154 \begin{center}
155 \IfFileExists{#1-\genericimg-\specimg.png}
156 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\specimg.png}
157 \typeout{Note: device specific image used}}
158 {\IfFileExists{#1-\genericimg.png}
159 {\includegraphics[width=\screenshotsize]{#1-\genericimg.png}}
160 {\IfFileExists{#1}
161 {\includegraphics[width=\screenshotsize]{#1}
162 \typeout{Warning: deprecated plain image name used}}%
163 {\typeout{Missing image: #1 (\genericimg) (\specimg)}%
164 \color{red}{\textbf{WARNING!} Image not found}%
168 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
169 \caption{#2}}\fi
170 \end{center}
171 \end{figure}
174 % command to display a note.
175 % Usage: \note{text of your note}
176 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
177 \ifpdfoutput{
178 \newcommand{\note}[1]{
179 \ifinner\else\vspace{1ex}\par\noindent\fi
180 \textbf{Note:}\ %
181 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\vspace{1ex}\fi%
183 {\newcommand{\note}[1]{\ifinner\else\par\noindent\fi\textbf{Note:{} }#1\par}}
185 % command to display a warning.
186 % Usage: \warn{text of your warning}
187 % Note: do NOT use \textbf or similar to emphasize text!
188 \ifpdfoutput{
189 \newcommand{\warn}[1]{
190 \ifinner\else\par\noindent\fi
191 \textbf{Warning:\ }%
192 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%
194 {\newcommand{\warn}[1]{\ifinner\else\par\noindent\fi\textbf{Warning:{} }#1}}
196 % command to mark a text block as intended especially for blind people
197 % Usage: \blind{text}
198 \ifpdfoutput{
199 \newcommand{\blind}[1]{
200 \ifinner\else\par\noindent\fi
201 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\ForwardToEnd}}#1\par\fi%
203 {\newcommand{\blind}[1]{\ifinner\else\par\noindent\fi#1}}
205 % make table floats use "H" (as for screenshots) as default positioning
206 \makeatletter\renewcommand{\fps@table}{H}\makeatother
207 % change defaults for floats on a page as we have a lot of small images
208 \setcounter{topnumber}{3} % default: 2
209 \setcounter{bottomnumber}{2} % default: 1
210 \setcounter{totalnumber}{5} % default: 3
213 % Environment for typesetting tables in a consistent way. The header has
214 % a darker background; rows are white and light gray (alternating). Top,
215 % middle and bottom rules are automatically set.
217 % Params:
218 % #1 -- table width
219 % #2 -- column specification (as used in the package tabularx)
220 % #3 -- contents of the header row. The number of items must
221 % match the number of specs in #2
222 % #4 -- caption (optional). If used then this must be inside a floating
223 % environment, e.g. table
224 % #5 -- label (optional)
226 % Example:
227 % \begin{rbtabular}{0.9\textwidth}{lX}{Col1 & Col2}{}{}
228 % A1 & A2\\
229 % B1 & B2\\
230 % C1 & C2\\
231 % \end{rbtabular}
233 \newenvironment{rbtabular}[5]{%
234 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
235 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
236 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
237 \bottomrule
238 \SavedEndTab%
239 \if\given{#4}\caption{#4}\fi%
240 \if\given{#5}\label{#5}\fi%
241 \endcenter%
243 \center
244 \tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor}
245 \tblhdrstrut#3\\\midrule
247 \endtabularx
253 % command to set the default table heading for button lists
254 \newcommand{\taghead}{\tblhdrstrut\textbf{Tag} & \textbf{Description} \\\midrule}
256 % environment intended to be used with tag maps (for wps)
257 % usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{tagmap}
258 % Note: this automatically sets the table lines.
259 % Note: you *need* to terminate the last line with a linebreak \\
260 % Cheers for the usenet helping me building this up :)
261 \newenvironment{tagmap}{%
262 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
263 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
264 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
265 \bottomrule
266 \SavedEndTab%
267 \endcenter%
269 \center
270 \tabularx{\textwidth}{lX}\toprule\rowcolor{tblhdrbgcolor} % here is the table width defined
271 \taghead
273 \endtabularx
276 % When creating HTML, use the soul package.
277 % This produces much nicer HTML code (textsc results in each character being
278 % put in a separate <span>).
279 \ifpdfoutput{\newcommand{\caps}[1]{\textsc{#1}}}{\usepackage{soul}}
280 \newcommand{\setting}[1]{\caps{#1}}
282 \newcommand{\config}[1]{\texttt{#1}}
284 % set link to download server
285 % Usage: \download{bootloader/bootloader-ipodnano.ipod}
286 % gets expanded to
287 % "http://download.rockbox.org/bootloader/bootloader-ipodnano.ipod"
288 \newcommand{\download}[1]{\url{http://download.rockbox.org/#1}}
290 % set link to the wiki.
291 % Usage: \wikilink{WebHome}
292 % with "WebHome" being the wiki page name
293 \newcommand{\wikibaseurl}{http://www.rockbox.org/wiki/}
294 \ifpdfoutput{\newcommand{\wikiicon}{\Pointinghand}}
295 {\newcommand{\wikiicon}{}}
296 \newcommand{\wikilink}[1]{\wikiicon{}\href{\wikibaseurl#1}{#1}}
297 %\newcommand{\wikilink}[1]{\url{http://www.rockbox.org/wiki/#1}}
299 % define environment "code" based on fancyvrb.
300 % use it to set code the user should type / see on his screen.
301 % Note: the first 4 characters of each line will be stripped,
302 % requiring everything to be indendet by exactly _4_ spaces!
303 % This is intended to make the LaTeX sources more readable.
304 % Note: when using the code environment you need to use optv instead of opt!
305 \DefineVerbatimEnvironment{code}{Verbatim}%
306 {framerule=0.4pt, framesep=1ex,frame=lines,%numbers=left,stepnumber=5,%
307 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
308 label=\textnormal{\textsc{Code}},%
309 commandchars=\\\{\}%
312 % define environment "example" based on fancyvrb.
313 % use it to set example code the user should type / see on his screen.
314 % Note: the first 4 characters of each line will be stripped,
315 % requiring everything to be indendet by exactly _4_ spaces!
316 % This is intended to make the LaTeX sources more readable.
317 % Note: when using the example environment you need to use optv instead of opt!
318 \DefineVerbatimEnvironment{example}{Verbatim}%
319 {commentchar=!,framerule=0.4pt, framesep=1ex,frame=lines,%
320 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
321 label=\textnormal{\textsc{Example}},%
322 commandchars=\\\{\}%
325 % Use the nopt command to exclude a certain defined feature from a section
326 % Example:
327 % \nopt{ondio}{This text will be excluded for ondios}
328 \makeatletter
329 \newcommand*\nopt[1]{\if\Opl@notlisted{#1}\expandafter\@firstofone
330 \else \expandafter\@gobble \fi}
331 \makeatother
333 % Use the reference to handle get a flexible reference command
334 % usage \reference{ref_section}
335 \ifpdfoutput{%
336 \newcommand{\reference}[1]{%
337 section~\ref{#1} (page~\pageref{#1})%
339 {\newcommand{\reference}[1]{section~\ref{#1}}}
341 % special HTML output adjustments
342 \ifpdfoutput{}{\setlength{\parindent}{0mm}}
343 \ifpdfoutput{}{\renewcommand{\Forward}[1]{$\triangleright${}#1}}
345 \newcommand{\btnfnt}[1]{\textbf{#1}}
346 %\hfuzz=2pt
348 % generate index
349 \usepackage{makeidx}
350 \makeindex
353 % command to set the default table heading for button lists
354 \newcommand{\btnhead}{\textbf{Key} \opt{HAVEREMOTEKEYMAP}{%
355 & \textbf{Remote Key}} & \textbf{Action} \\\midrule}
356 % environment intended to be used with button maps
357 % usage: \begin{btnmap} Button & ButtonAction \\ \end{btnmap}
358 % Note: this automatically sets the table lines.
359 % Note: you *need* to terminate the last line with a linebreak \\
360 % Cheers for the usenet helping me building this up :)
362 % tabularx is set to be either two or three columns wide depending on whether
363 % HAVEREMOTEKEYMAP is defined in the platform file for the target in question.
364 % If it is, then every button table has three columns of the form
365 % Main Unit Key & Remote Key & Description \\
367 \newenvironment{btnmap}{%
368 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
369 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
370 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
371 \bottomrule
372 \SavedEndTab%
373 \endcenter\vspace{2ex}%
375 \vspace{2ex}\center
376 \opt{HAVEREMOTEKEYMAP}{
377 % here is the table width defined for 3 columns
378 \tabularx{.95\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
380 \nopt{HAVEREMOTEKEYMAP}{
381 % here is the table width defined for 2 columns
382 \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
384 \tblhdrstrut\btnhead
386 \endtabularx