Rename sdl lcd initialization to (remote_)lcd_init_device which enables removing...
[kugel-rb.git] / manual / preamble.tex
blob23724ab287c73db26517d9f5af100b9b9c90bd42
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 % add screenshot image.
144 % Usage: \screenshot{filename}{caption}{label}
145 % By using the 'H' (HERE) placement, the screenshots are placed where
146 % we want them.
147 % Note: use this only for screenshots!
148 % Note: leave caption empty to supress it.
149 \newcommand{\screenshot}[3]{
150 \begin{figure}[H]
151 \begin{center}
152 \IfFileExists{#1-\genericimg-\specimg.png}
153 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\specimg.png}
154 \typeout{Note: device specific image used}}
155 {\IfFileExists{#1-\genericimg.png}
156 {\includegraphics[width=\screenshotsize]{#1-\genericimg.png}}
157 {\IfFileExists{#1}
158 {\includegraphics[width=\screenshotsize]{#1}
159 \typeout{Warning: deprecated plain image name used}}%
160 {\typeout{Missing image: #1 (\genericimg) (\specimg)}%
161 \color{red}{\textbf{WARNING!} Image not found}%
165 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
166 \caption{#2}}\fi
167 \end{center}
168 \end{figure}
171 % command to display a note.
172 % Usage: \note{text of your note}
173 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
174 \ifpdfoutput{
175 \newcommand{\note}[1]{
176 \ifinner\else\vspace{1ex}\par\noindent\fi
177 \textbf{Note:}\ %
178 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\vspace{1ex}\fi%
180 {\newcommand{\note}[1]{\ifinner\else\par\noindent\fi\textbf{Note:{} }#1\par}}
182 % command to display a warning.
183 % Usage: \warn{text of your warning}
184 % Note: do NOT use \textbf or similar to emphasize text!
185 \ifpdfoutput{
186 \newcommand{\warn}[1]{
187 \ifinner\else\par\noindent\fi
188 \textbf{Warning:\ }%
189 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%
191 {\newcommand{\warn}[1]{\ifinner\else\par\noindent\fi\textbf{Warning:{} }#1}}
193 % command to mark a text block as intended especially for blind people
194 % Usage: \blind{text}
195 \ifpdfoutput{
196 \newcommand{\blind}[1]{
197 \ifinner\else\par\noindent\fi
198 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\ForwardToEnd}}#1\par\fi%
200 {\newcommand{\blind}[1]{\ifinner\else\par\noindent\fi#1}}
202 % make table floats use "H" (as for screenshots) as default positioning
203 \makeatletter\renewcommand{\fps@table}{H}\makeatother
204 % change defaults for floats on a page as we have a lot of small images
205 \setcounter{topnumber}{3} % default: 2
206 \setcounter{bottomnumber}{2} % default: 1
207 \setcounter{totalnumber}{5} % default: 3
210 % Environment for typesetting tables in a consistent way. The header has
211 % a darker background; rows are white and light gray (alternating). Top,
212 % middle and bottom rules are automatically set.
214 % Params:
215 % #1 -- table width
216 % #2 -- column specification (as used in the package tabularx)
217 % #3 -- contents of the header row. The number of items must
218 % match the number of specs in #2
219 % #4 -- caption (optional). If used then this must be inside a floating
220 % environment, e.g. table
221 % #5 -- label (optional)
223 % Example:
224 % \begin{rbtabular}{0.9\textwidth}{lX}{Col1 & Col2}{}{}
225 % A1 & A2\\
226 % B1 & B2\\
227 % C1 & C2\\
228 % \end{rbtabular}
230 \newenvironment{rbtabular}[5]{%
231 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
232 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
233 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
234 \bottomrule
235 \SavedEndTab%
236 \if\given{#4}\caption{#4}\fi%
237 \if\given{#5}\label{#5}\fi%
238 \endcenter%
240 \center
241 \tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor}
242 \tblhdrstrut#3\\\midrule
244 \endtabularx
250 % command to set the default table heading for button lists
251 \newcommand{\taghead}{\tblhdrstrut\textbf{Tag} & \textbf{Description} \\\midrule}
253 % environment intended to be used with tag maps (for wps)
254 % usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{tagmap}
255 % Note: this automatically sets the table lines.
256 % Note: you *need* to terminate the last line with a linebreak \\
257 % Cheers for the usenet helping me building this up :)
258 \newenvironment{tagmap}{%
259 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
260 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
261 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
262 \bottomrule
263 \SavedEndTab%
264 \endcenter%
266 \center
267 \tabularx{\textwidth}{lX}\toprule\rowcolor{tblhdrbgcolor} % here is the table width defined
268 \taghead
270 \endtabularx
273 % When creating HTML, use the soul package.
274 % This produces much nicer HTML code (textsc results in each character being
275 % put in a separate <span>).
276 \ifpdfoutput{\newcommand{\caps}[1]{\textsc{#1}}}{\usepackage{soul}}
277 \newcommand{\setting}[1]{\caps{#1}}
279 \newcommand{\config}[1]{\texttt{#1}}
281 % set link to download server
282 % Usage: \download{bootloader/bootloader-ipodnano.ipod}
283 % gets expanded to
284 % "http://download.rockbox.org/bootloader/bootloader-ipodnano.ipod"
285 \newcommand{\download}[1]{\url{http://download.rockbox.org/#1}}
287 % set link to the wiki.
288 % Usage: \wikilink{WebHome}
289 % with "WebHome" being the wiki page name
290 \newcommand{\wikibaseurl}{http://www.rockbox.org/wiki/}
291 \ifpdfoutput{\newcommand{\wikiicon}{\Pointinghand}}
292 {\newcommand{\wikiicon}{}}
293 \newcommand{\wikilink}[1]{\wikiicon{}\href{\wikibaseurl#1}{#1}}
294 %\newcommand{\wikilink}[1]{\url{http://www.rockbox.org/wiki/#1}}
296 % define environment "code" based on fancyvrb.
297 % use it to set code the user should type / see on his screen.
298 % Note: the first 4 characters of each line will be stripped,
299 % requiring everything to be indendet by exactly _4_ spaces!
300 % This is intended to make the LaTeX sources more readable.
301 % Note: when using the code environment you need to use optv instead of opt!
302 \DefineVerbatimEnvironment{code}{Verbatim}%
303 {framerule=0.4pt, framesep=1ex,frame=lines,%numbers=left,stepnumber=5,%
304 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
305 label=\textnormal{\textsc{Code}},%
306 commandchars=\\\{\}%
309 % define environment "example" based on fancyvrb.
310 % use it to set example code the user should type / see on his screen.
311 % Note: the first 4 characters of each line will be stripped,
312 % requiring everything to be indendet by exactly _4_ spaces!
313 % This is intended to make the LaTeX sources more readable.
314 % Note: when using the example environment you need to use optv instead of opt!
315 \DefineVerbatimEnvironment{example}{Verbatim}%
316 {commentchar=!,framerule=0.4pt, framesep=1ex,frame=lines,%
317 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
318 label=\textnormal{\textsc{Example}},%
319 commandchars=\\\{\}%
322 % Use the nopt command to exclude a certain defined feature from a section
323 % Example:
324 % \nopt{ondio}{This text will be excluded for ondios}
325 \makeatletter
326 \newcommand*\nopt[1]{\if\Opl@notlisted{#1}\expandafter\@firstofone
327 \else \expandafter\@gobble \fi}
328 \makeatother
330 % Use the reference to handle get a flexible reference command
331 % usage \reference{ref_section}
332 \ifpdfoutput{%
333 \newcommand{\reference}[1]{%
334 section~\ref{#1} (page~\pageref{#1})%
336 {\newcommand{\reference}[1]{section~\ref{#1}}}
338 % special HTML output adjustments
339 \ifpdfoutput{}{\setlength{\parindent}{0mm}}
340 \ifpdfoutput{}{\renewcommand{\Forward}[1]{$\triangleright${}#1}}
342 \newcommand{\btnfnt}[1]{\textbf{#1}}
343 %\hfuzz=2pt
345 % generate index
346 \usepackage{makeidx}
347 \makeindex
350 % command to set the default table heading for button lists
351 \newcommand{\btnhead}{\textbf{Key} \opt{HAVEREMOTEKEYMAP}{%
352 & \textbf{Remote Key}} & \textbf{Action} \\\midrule}
353 % environment intended to be used with button maps
354 % usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
355 % Note: this automatically sets the table lines.
356 % Note: you *need* to terminate the last line with a linebreak \\
357 % Note: you still need to enclose this with \begin{table} / \end{table}
358 % Cheers for the usenet helping me building this up :)
360 % tabularx is set to be either two or three columns wide depending on whether
361 % HAVEREMOTEKEYMAP is defined in the platform file for the target in question.
362 % If it is, then every button table has three columns of the form
363 % Main Unit Key & Remote Key & Description \\
365 \newenvironment{btnmap}[2]{%
366 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
367 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
368 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
369 \bottomrule
370 \SavedEndTab%
371 \if\given{#1}\caption{#1}\fi%
372 \if\given{#2}\label{#2}\fi%
373 \endcenter%
375 \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