Manual: Platform files - split out the button and action commands from the platform...
[kugel-rb.git] / manual / preamble.tex
blob3ac9edcf0e327790bf4c3983b84cf3ee6e381802
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[utf8x]{inputenc}
24 \usepackage{palatino}
26 \usepackage{tabularx}
27 \usepackage{multirow}
28 \usepackage{multicol}
30 \usepackage{float}
31 \floatstyle{ruled}
33 \usepackage{hyperref}
34 \usepackage{enumitem}
36 \usepackage{optional}
38 \input{platform/\platform.tex}
39 \input{features.tex}
41 \newcommand{\playername}{\playerman\ \playerlongtype}
43 \hypersetup{% add some values to the pdf properties
44 colorlinks = true,
45 pdfstartview = FitV,
46 linkcolor = blue,
47 citecolor = blue,
48 urlcolor = blue,
49 pdftitle = {Rockbox user manual},
50 pdfauthor = {The Rockbox Team},
51 pdfsubject = {Rockbox user manual for \playername}
54 \newcommand{\fname}[1]{\texttt{#1}}
55 \newcommand{\tabeltc}[1]{{\centering #1 \par}}
56 \newcommand{\tabelth}[1]{{\centering \textbf{\textit{#1}} \par}}
58 \newcommand{\fixme}[1]{\textbf{\textcolor{red}{#1}}}
60 \usepackage{fancyhdr}
61 \usepackage{graphicx}
62 \usepackage{verbatim}
63 \usepackage{makeidx}
64 \usepackage{fancyvrb}
65 \usepackage{enumerate}
66 \usepackage{color}
67 \ifpdfoutput{\usepackage{booktabs}}%
68 {\newcommand{%
69 \toprule}{}\newcommand{\midrule}{\hline}\newcommand{\bottomrule}{}%
71 \usepackage{longtable}
72 \usepackage{url}
73 \urlstyle{sf}
74 \usepackage{marvosym}
75 \usepackage{ifthen}
76 \usepackage{rotating}
78 % pdf output: try pdf first, then png and jpg as file format
79 % html output: try png first, then jpg. Ignore pdf files
80 % this only applies if no file extension is given!
81 \ifpdfoutput{\DeclareGraphicsExtensions{.pdf,.png,.jpg}}%
82 {\DeclareGraphicsExtensions{.png,.jpg}}
84 % fancy header style adjustments
85 \fancyhead{}
86 \fancyfoot{}
87 \fancyhead[L]{{\nouppercase{\textsc{\leftmark}}}}
88 \fancyhead[R]{\iffloatpage{}{\thepage}}
89 \fancyfoot[L]{\textsc{The Rockbox manual}}
90 \fancyfoot[R]{\textsc{\playerman{} \playertype}}
91 \fancypagestyle{plain}{}
93 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
94 \renewcommand{\footrulewidth}{\iffloatpage{0pt}{0.4pt}}
95 \setlength{\headheight}{18.5pt}
96 \newcounter{example}[chapter]
98 %% \newenvironment{example}
99 %% {\stepcounter{example}\paragraph{Example \theexample:}}
100 %% {\hfill$\Box$
102 %% \bigskip
103 %% \noindent}
105 % found on the internet, posting by Donald Arseneau
106 % I may as well include my robust expandable definions, which can be
107 % used in \edef or \write where the \def would not be executed:
109 % \if\blank --- checks if parameter is blank (Spaces count as blank)
110 % \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
111 % \if\nil --- checks if parameter is null (spaces are NOT null)
112 % use \if\given{ } ... \else ... \fi etc.
114 {\catcode`\!=8 % funny catcode so ! will be a delimiter
115 \catcode`\Q=3 % funny catcode so Q will be a delimiter
116 \long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
117 \long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
118 \long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
119 \long\gdef\IfN@Ught#1 #2!{\blank{#2}}
120 \long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
123 % environment for setting the changelog.
124 \newenvironment{changelog}%
125 {\renewcommand{\labelitemi}{$\star$}\setitemize{noitemsep,topsep=0pt}%
126 \begin{itemize}}%
127 {\end{itemize}}
130 % add screenshot image.
131 % Usage: \screenshot{filename}{caption}{label}
132 % By using the 'H' (HERE) placement, the screenshots are placed where
133 % we want them.
134 % Note: use this only for screenshots!
135 % Note: leave caption empty to supress it.
136 \newcommand{\screenshot}[3]{
137 \begin{figure}[H]
138 \begin{center}
139 \IfFileExists{#1-\genericimg-\specimg.png}
140 {\includegraphics[width=\screenshotsize]{#1-\genericimg-\specimg.png}
141 \typeout{Note: device specific image used}}
142 {\IfFileExists{#1-\genericimg.png}
143 {\includegraphics[width=\screenshotsize]{#1-\genericimg.png}}
144 {\IfFileExists{#1}
145 {\includegraphics[width=\screenshotsize]{#1}
146 \typeout{Warning: deprecated plain image name used}}%
147 {\typeout{Missing image: #1 (\genericimg) (\specimg)}%
148 \color{red}{\textbf{WARNING!} Image not found}%
152 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
153 \caption{#2}}\fi
154 \end{center}
155 \end{figure}
158 % command to display a note.
159 % Usage: \note{text of your note}
160 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
161 \ifpdfoutput{
162 \newcommand{\note}[1]{
163 \ifinner\else\par\noindent\fi
164 \textbf{Note:}\ %
165 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\fi%
167 {\newcommand{\note}[1]{\ifinner\else\par\noindent\fi\textbf{Note:{} }#1\par}}
169 % command to display a warning.
170 % Usage: \warn{text of your warning}
171 % Note: do NOT use \textbf or similar to emphasize text!
172 \ifpdfoutput{
173 \newcommand{\warn}[1]{
174 \ifinner\else\par\noindent\fi
175 \textbf{Warning:\ }%
176 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%
178 {\newcommand{\warn}[1]{\ifinner\else\par\noindent\fi\textbf{Warning:{} }#1}}
180 % command to mark a text block as intended especially for blind people
181 % Usage: \blind{text}
182 \ifpdfoutput{
183 \newcommand{\blind}[1]{
184 \ifinner\else\par\noindent\fi
185 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\ForwardToEnd}}#1\par\fi%
187 {\newcommand{\blind}[1]{\ifinner\else\par\noindent\fi#1}}
189 % make table floats use "H" (as for screenshots) as default positioning
190 \makeatletter\renewcommand{\fps@table}{H}\makeatother
191 % change defaults for floats on a page as we have a lot of small images
192 \setcounter{topnumber}{3} % default: 2
193 \setcounter{bottomnumber}{2} % default: 1
194 \setcounter{totalnumber}{5} % default: 3
196 % command to set the default table heading for button lists
197 \newcommand{\btnhead}{\textbf{Key} & \textbf{Action} \\\midrule}
199 % environment intended to be used with button maps
200 % usage: \begin{btnmap}{caption}{label} Button & ButtonAction \\ \end{btnmap}
201 % Note: this automatically sets the table lines.
202 % Note: you *need* to terminate the last line with a linebreak \\
203 % Note: you still need to enclose this with \begin{table} / \end{table}
204 % Cheers for the usenet helping me building this up :)
205 \newenvironment{btnmap}[2]{%
206 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
207 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
208 \bottomrule
209 \SavedEndTab%
210 \if\given{#1}\caption{#1}\fi%
211 \if\given{#2}\label{#2}\fi%
212 \endcenter%
214 \center
215 \tabularx{.75\textwidth}{>{\raggedright\arraybackslash}p{.22\textwidth}X}\toprule % here is the table width defined
216 \btnhead
218 \endtabularx
221 % command to set the default table heading for button lists
222 \newcommand{\taghead}{\textbf{Tag} & \textbf{Description} \\\midrule}
224 % environment intended to be used with tag maps (for wps)
225 % usage: \begin{tagmap}{caption}{label} Tag & Description \\ \end{btnmap}
226 % Note: this automatically sets the table lines.
227 % Note: you *need* to terminate the last line with a linebreak \\
228 % Note: you still need to enclose this with \begin{table} / \end{table}
229 % Cheers for the usenet helping me building this up :)
230 \newenvironment{tagmap}[2]{%
231 \expandafter\let\expandafter\SavedEndTab\csname endtabular*\endcsname
232 \expandafter\renewcommand\expandafter*\csname endtabular*\endcsname{%
233 \bottomrule
234 \SavedEndTab%
235 \if\given{#1}\caption{#1}\fi%
236 \if\given{#2}\label{#2}\fi%
237 \endcenter%
239 \center
240 \tabularx{\textwidth}{lX}\toprule % here is the table width defined
241 \taghead
243 \endtabularx
246 \newcommand{\setting}[1]{\textsc{#1}}
248 \newcommand{\config}[1]{\texttt{#1}}
250 % set link to download server
251 % Usage: \download{bootloader/bootloader-ipodnano.ipod}
252 % gets expanded to
253 % "http://download.rockbox.org/bootloader/bootloader-ipodnano.ipod"
254 \newcommand{\download}[1]{\url{http://download.rockbox.org/#1}}
256 % set link to the wiki.
257 % Usage: \wikilink{WebHome}
258 % with "WebHome" being the wiki page name
259 \newcommand{\wikibaseurl}{http://www.rockbox.org/wiki/}
260 \ifpdfoutput{\newcommand{\wikiicon}{\Pointinghand}}
261 {\newcommand{\wikiicon}{}}
262 \newcommand{\wikilink}[1]{\wikiicon{}\href{\wikibaseurl#1}{#1}}
263 %\newcommand{\wikilink}[1]{\url{http://www.rockbox.org/wiki/#1}}
265 % define environment "code" based on fancyvrb.
266 % use it to set code the user should type / see on his screen.
267 % Note: the first 4 characters of each line will be stripped,
268 % requiring everything to be indendet by exactly _4_ spaces!
269 % This is intended to make the LaTeX sources more readable.
270 % Note: when using the code environment you need to use optv instead of opt!
271 \DefineVerbatimEnvironment{code}{Verbatim}%
272 {framerule=0.4pt, framesep=1ex,frame=lines,%numbers=left,stepnumber=5,%
273 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
274 label=\textnormal{\textsc{Code}},%
275 commandchars=\\\{\}%
278 % define environment "example" based on fancyvrb.
279 % use it to set example code the user should type / see on his screen.
280 % Note: the first 4 characters of each line will be stripped,
281 % requiring everything to be indendet by exactly _4_ spaces!
282 % This is intended to make the LaTeX sources more readable.
283 % Note: when using the example environment you need to use optv instead of opt!
284 \DefineVerbatimEnvironment{example}{Verbatim}%
285 {commentchar=!,framerule=0.4pt, framesep=1ex,frame=lines,%
286 gobble=4,fontsize=\footnotesize,xleftmargin=10pt,xrightmargin=10pt,%
287 label=\textnormal{\textsc{Example}},%
288 commandchars=\\\{\}%
291 % Use the nopt command to exclude a certain defined feature from a sectio
292 % Example:
293 % \nopt{ondio}{This text will be excluded for ondios}
294 \newcommand{\optnvalue}{0}
295 \newcommand{\nopt}[2]{%
296 \renewcommand{\optnvalue}{0}\opt{#1}{\renewcommand{\optnvalue}{1}}%
297 \ifthenelse{\optnvalue > 0}{}{#2}%
300 % Use the reference to handle get a flexible reference command
301 % usage \reference{ref_section}
302 \ifpdfoutput{%
303 \newcommand{\reference}[1]{%
304 section~\ref{#1} (page~\pageref{#1})%
306 {\newcommand{\reference}[1]{section~\ref{#1}}}
308 % special HTML output adjustments
309 \ifpdfoutput{}{\setlength{\parindent}{0mm}}
310 \ifpdfoutput{}{\renewcommand{\Forward}[1]{$\triangleright${}#1}}
312 \newcommand{\btnfnt}[1]{\textbf{#1}}
313 %\hfuzz=2pt
315 % generate index
316 \usepackage{makeidx}
317 \makeindex