Android: Partly revert r29569 and only call the new getJavaEnvironment() when needed.
[maemo-rb.git] / manual / preamble.tex
blob8ff9c08f455b878d79ba51b46771c3abff70f9c7
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]{inputenx}
24 \usepackage[T1]{fontenc}
25 % load ix-utf8enc.dfu to get additional characters from the inputenx package.
26 \makeatletter\input{ix-utf8enc.dfu}\makeatother
27 % This manual used to use Palatino as font. This caused issues with small caps
28 % (textsc), so do not use that font as default one anymore.
30 \usepackage{tabularx}
31 \usepackage{multirow}
32 \usepackage{multicol}
34 \usepackage{float}
35 \floatstyle{ruled}
37 \usepackage{hyperref}
38 \usepackage{enumitem}
40 \usepackage{optional}
42 \usepackage[table]{xcolor}
44 \input{platform/\platform.tex}
45 \input{features.tex}
47 \newcommand{\playername}{\playerman\ \playerlongtype}
49 \hypersetup{% add some values to the pdf properties
50 colorlinks = true,
51 pdfstartview = FitV,
52 linkcolor = blue,
53 citecolor = blue,
54 urlcolor = blue,
55 pdftitle = {Rockbox user manual},
56 pdfauthor = {The Rockbox Team},
57 pdfsubject = {Rockbox user manual for \playername}
60 \newcommand{\fname}[1]{\texttt{#1}}
61 \newcommand{\tabeltc}[1]{{\centering #1 \par}}
62 \newcommand{\tabelth}[1]{{\centering \textbf{\textit{#1}} \par}}
64 \newcommand{\fixme}[1]{\textbf{\textcolor{red}{#1}}}
66 % Colors used to typeset table headers and alternating table rows
67 \colorlet{tblhdrbgcolor}{blue!30} % Background color for headers
68 \colorlet{tbloddrowbgcolor}{blue!10} % Background color for odd rows (headers not included)
69 \colorlet{tblevenrowbgcolor}{white} % Background color for even rows (headers not included)
71 \usepackage{fancyhdr}
72 \usepackage{graphicx}
73 \usepackage{verbatim}
74 \usepackage{makeidx}
75 \usepackage{fancyvrb}
76 \usepackage{color}
77 \ifpdfoutput{\usepackage{booktabs}}%
78 {\newcommand{%
79 \toprule}{}\newcommand{\midrule}{\hline}\newcommand{\bottomrule}{}%
81 \usepackage{longtable}
82 \usepackage{url}
83 \urlstyle{sf}
84 \usepackage{marvosym}
85 \usepackage{rotating}
87 % pdf output: try pdf first, then png and jpg as file format
88 % html output: try png first, then jpg. Ignore pdf files
89 % this only applies if no file extension is given!
90 \ifpdfoutput{\DeclareGraphicsExtensions{.pdf,.png,.jpg}}%
91 {\DeclareGraphicsExtensions{.png,.jpg}}
93 % fancy header style adjustments
94 \fancyhead{}
95 \fancyfoot{}
96 \fancyhead[L]{{\nouppercase{\textsc{\leftmark}}}}
97 \fancyhead[R]{\iffloatpage{}{\thepage}}
98 \fancyfoot[L]{\textsc{The Rockbox manual}}
99 \fancyfoot[R]{\textsc{\playerman{} \playertype}}
100 \fancypagestyle{plain}{}
102 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
103 \renewcommand{\footrulewidth}{\iffloatpage{0pt}{0.4pt}}
104 \setlength{\headheight}{18.5pt}
105 \newcounter{example}[chapter]
107 \ifpdfoutput{%
108 \renewcommand{\toprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}}
109 \renewcommand{\midrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
111 \newcommand{\tblhdrstrut}{\rule[-1.3ex]{0mm}{4.0ex}}
114 %% \newenvironment{example}
115 %% {\stepcounter{example}\paragraph{Example \theexample:}}
116 %% {\hfill$\Box$
118 %% \bigskip
119 %% \noindent}
121 % found on the internet, posting by Donald Arseneau
122 % I may as well include my robust expandable definions, which can be
123 % used in \edef or \write where the \def would not be executed:
125 % \if\blank --- checks if parameter is blank (Spaces count as blank)
126 % \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
127 % \if\nil --- checks if parameter is null (spaces are NOT null)
128 % use \if\given{ } ... \else ... \fi etc.
130 {\catcode`\!=8 % funny catcode so ! will be a delimiter
131 \catcode`\Q=3 % funny catcode so Q will be a delimiter
132 \long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
133 \long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
134 \long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
135 \long\gdef\IfN@Ught#1 #2!{\blank{#2}}
136 \long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
139 % environment for setting the changelog.
140 \newenvironment{changelog}%
141 {\renewcommand{\labelitemi}{$\star$}\setitemize{noitemsep,topsep=0pt}%
142 \begin{itemize}}%
143 {\end{itemize}}
146 \newcommand{\dapdisplaysize}{\dapdisplaywidth$\times$\dapdisplayheight$\times$\dapdisplaydepth}
147 \newcommand{\genericimg}{\dapdisplaywidth x\dapdisplayheight x\dapdisplaydepth}
149 % add screenshot image.
150 % Usage: \screenshot{filename}{caption}{label}
151 % By using the 'H' (HERE) placement, the screenshots are placed where
152 % we want them.
153 % Note: use this only for screenshots!
154 % Note: leave caption empty to supress it.
155 % Resulting file names in the source should consist of up to 3 parts
156 % "filename-\genericimg-[\specimg|\seriesimg]" (the third is optional)
157 % filename is specified by the use of this macro in the tex file
158 % \genericimg will be generated using the display's resolution (see above)
159 % \specimg or \seriesimg are possible options set in the platform files
160 % Files will be used in the following order: 1.filename contains \specimg part
161 % 2. filename contains \seriesimg part, 3. filename without the third part
163 % set seriesimg if it isn't defined in the platform file to not break manuals
164 \ifdefined\seriesimg
165 \else
166 \newcommand{\seriesimg}{\specimg}
169 \newcommand{\screenshot}[3]{
170 \begin{figure}[H]
171 \begin{center}
172 \IfFileExists{#1-\genericimg-\specimg.png}
173 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\specimg.png}
174 \typeout{Note: device specific image used}}
175 {\IfFileExists{#1-\genericimg-\seriesimg.png}
176 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\seriesimg.png}
177 \typeout{Note: series specific image used}}
178 {\IfFileExists{#1-\genericimg.png}
179 {\includegraphics[width=\screenshotsize]{#1-\genericimg.png}}
180 {\IfFileExists{#1}
181 {\includegraphics[width=\screenshotsize]{#1}
182 \typeout{Warning: deprecated plain image name used}}%
183 {\typeout{Missing image: #1 (\genericimg) (\specimg)}%
184 \color{red}{\textbf{WARNING!} Image not found}%
189 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
190 \caption{#2}}\fi
191 \end{center}
192 \end{figure}
195 % command to display a note.
196 % Usage: \note{text of your note}
197 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
198 \ifpdfoutput{
199 \newcommand{\note}[1]{
200 \ifinner\else\vspace{1ex}\par\noindent\fi
201 \textbf{Note:}\ %
202 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\vspace{1ex}\fi%
204 {\newcommand{\note}[1]{\ifinner\else\par\noindent\fi\textbf{Note:{} }#1\par}}
206 % command to display a warning.
207 % Usage: \warn{text of your warning}
208 % Note: do NOT use \textbf or similar to emphasize text!
209 \ifpdfoutput{
210 \newcommand{\warn}[1]{
211 \ifinner\else\par\noindent\fi
212 \textbf{Warning:\ }%
213 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%
215 {\newcommand{\warn}[1]{\ifinner\else\par\noindent\fi\textbf{Warning:{} }#1}}
217 % command to mark a text block as intended especially for blind people
218 % Usage: \blind{text}
219 \ifpdfoutput{
220 \newcommand{\blind}[1]{\mbox{}\marginpar{\raisebox{-1ex}{\Huge{\ForwardToEnd}}}#1}
222 {\newcommand{\blind}[1]{\ifinner\else\par\noindent\fi#1}}
224 % make table floats use "H" (as for screenshots) as default positioning
225 \makeatletter\renewcommand{\fps@table}{H}\makeatother
226 % change defaults for floats on a page as we have a lot of small images
227 \setcounter{topnumber}{3} % default: 2
228 \setcounter{bottomnumber}{2} % default: 1
229 \setcounter{totalnumber}{5} % default: 3
232 % Environment for typesetting tables in a consistent way. The header has
233 % a darker background; rows are white and light gray (alternating). Top,
234 % middle and bottom rules are automatically set.
236 % Params:
237 % #1 -- table width
238 % #2 -- column specification (as used in the package tabularx)
239 % #3 -- contents of the header row. The number of items must
240 % match the number of specs in #2
241 % #4 -- caption (optional). If used then this must be inside a floating
242 % environment, e.g. table
243 % #5 -- label (optional)
245 % Example:
246 % \begin{rbtabular}{0.9\textwidth}{lX}{Col1 & Col2}{}{}
247 % A1 & A2\\
248 % B1 & B2\\
249 % C1 & C2\\
250 % \end{rbtabular}
252 \newenvironment{rbtabular}[5]{%
253 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
254 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
255 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
256 \bottomrule
257 \SavedEndTab%
258 \if\given{#4}\caption{#4}\fi%
259 \if\given{#5}\label{#5}\fi%
260 \endcenter%
262 \center
263 \tabularx{#1}{#2}\toprule\rowcolor{tblhdrbgcolor}
264 \tblhdrstrut#3\\\midrule
266 \endtabularx
269 \newcommand{\tabnlindent}{\newline\mbox{ }\mbox{ }}
273 % command to set the default table heading for button lists
274 \newcommand{\taghead}{\tblhdrstrut\textbf{Tag} & \textbf{Description} \\\midrule}
276 % environment intended to be used with tag maps (for wps)
277 % usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{tagmap}
278 % Note: this automatically sets the table lines.
279 % Note: you *need* to terminate the last line with a linebreak \\
280 % Cheers for the usenet helping me building this up :)
281 \newenvironment{tagmap}{%
282 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
283 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
284 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
285 \bottomrule
286 \SavedEndTab%
287 \endcenter%
289 \center
290 \tabularx{\textwidth}{Xp{.7\textwidth}}\toprule\rowcolor{tblhdrbgcolor} % here is the table width defined
291 \taghead
293 \endtabularx
296 % When creating HTML, use the soul package.
297 % This produces much nicer HTML code (textsc results in each character being
298 % put in a separate <span>).
299 \ifpdfoutput{\newcommand{\caps}[1]{\textsc{#1}}}{\usepackage{soul}}
300 \newcommand{\setting}[1]{\caps{#1}}
302 \newcommand{\config}[1]{\texttt{#1}}
304 % set link to download server
305 % Usage: \download{bootloader/bootloader-ipodnano.ipod}
306 % gets expanded to
307 % "http://download.rockbox.org/bootloader/bootloader-ipodnano.ipod"
308 \newcommand{\download}[1]{\url{http://download.rockbox.org/#1}}
310 % set link to the wiki.
311 % Usage: \wikilink{WebHome}
312 % with "WebHome" being the wiki page name
313 \newcommand{\wikibaseurl}{http://www.rockbox.org/wiki/}
314 \ifpdfoutput{\newcommand{\wikiicon}{\Pointinghand}}
315 {\newcommand{\wikiicon}{}}
316 \newcommand{\wikilink}[1]{\wikiicon{}\href{\wikibaseurl#1}{#1}}
317 %\newcommand{\wikilink}[1]{\url{http://www.rockbox.org/wiki/#1}}
319 % define environment "code" based on fancyvrb.
320 % use it to set code the user should type / see on his screen.
321 % Note: the first 4 characters of each line will be stripped,
322 % requiring everything to be indendet by exactly _4_ spaces!
323 % This is intended to make the LaTeX sources more readable.
324 % Note: when using the code environment you need to use optv instead of opt!
325 \DefineVerbatimEnvironment{code}{Verbatim}%
326 {framerule=0.4pt, framesep=1ex,frame=lines,%numbers=left,stepnumber=5,%
327 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
328 label=\textnormal{\textsc{Code}},%
329 commandchars=\\\{\}%
332 % define environment "example" based on fancyvrb.
333 % use it to set example code the user should type / see on his screen.
334 % Note: the first 4 characters of each line will be stripped,
335 % requiring everything to be indendet by exactly _4_ spaces!
336 % This is intended to make the LaTeX sources more readable.
337 % Note: when using the example environment you need to use optv instead of opt!
338 \DefineVerbatimEnvironment{example}{Verbatim}%
339 {commentchar=!,framerule=0.4pt, framesep=1ex,frame=lines,%
340 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
341 label=\textnormal{\textsc{Example}},%
342 commandchars=\\\{\}%
345 % Use the nopt command to exclude a certain defined feature from a section
346 % Example:
347 % \nopt{ondio}{This text will be excluded for ondios}
348 \makeatletter
349 \newcommand*\nopt[1]{\if\Opl@notlisted{#1}\expandafter\@firstofone
350 \else \expandafter\@gobble \fi}
351 \makeatother
353 % Use the reference to handle get a flexible reference command
354 % usage \reference{ref_section}
355 \ifpdfoutput{%
356 \newcommand{\reference}[1]{%
357 section~\ref{#1} (page~\pageref{#1})%
359 {\newcommand{\reference}[1]{section~\ref{#1}}}
361 % special HTML output adjustments
362 \ifpdfoutput{}{\setlength{\parindent}{0mm}}
363 \ifpdfoutput{}{\renewcommand{\Forward}[1]{$\triangleright${}#1}}
365 \newcommand{\btnfnt}[1]{\textbf{#1}}
366 %\hfuzz=2pt
368 % generate index
369 \usepackage{makeidx}
370 \makeindex
373 % command to set the default table heading for button lists
374 \newcommand{\btnhead}{\textbf{Key} \opt{HAVEREMOTEKEYMAP}{%
375 & \textbf{Remote Key}} & \textbf{Action} \\\midrule}
376 % environment intended to be used with button maps
377 % usage: \begin{btnmap} Button & ButtonAction \\ \end{btnmap}
378 % Note: this automatically sets the table lines.
379 % Note: you *need* to terminate the last line with a linebreak \\
380 % Cheers for the usenet helping me building this up :)
382 % tabularx is set to be either two or three columns wide depending on whether
383 % HAVEREMOTEKEYMAP is defined in the platform file for the target in question.
384 % If it is, then every button table has three columns of the form
385 % Main Unit Key & Remote Key & Description \\
387 \newenvironment{btnmap}{%
388 \rowcolors{2}{tbloddrowbgcolor}{tblevenrowbgcolor}
389 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
390 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
391 \bottomrule
392 \SavedEndTab%
393 \endcenter\vspace{2ex}%
395 \vspace{2ex}\center
396 \opt{HAVEREMOTEKEYMAP}{
397 % here is the table width defined for 3 columns
398 \tabularx{.95\textwidth}{>{\raggedright\arraybackslash}p{.2\textwidth}>{\raggedright\arraybackslash}p{.2\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
400 \nopt{HAVEREMOTEKEYMAP}{
401 % here is the table width defined for 2 columns
402 \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule\rowcolor{tblhdrbgcolor}
404 \tblhdrstrut\btnhead
406 \endtabularx