Extention of \screenshot to drop a warning if image not found by me. This makes it...
[Rockbox.git] / manual / preamble.tex
blobfb6fdc2a54e40f8053e8e80bf36d79341c2c91c8
1 \documentclass[a4paper,11pt]{scrreprt}
2 \usepackage[latin1]{inputenc}
3 \usepackage{palatino}
4 %\renewcommand{\familydefault}{\sfdefault}
6 %Comment this out at release
7 \usepackage{pdfdraftcopy}
8 \draftstring{DRAFT VERSION}
9 %\draftangle{45}
10 \usepackage{tabularx}
13 \usepackage{float}
14 \floatstyle{ruled}
16 \usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
17 \usepackage{xspace}
18 \usepackage{optional}
20 \input{platform/\platform.tex}
22 \newcommand{\playername}{\playerman\ \playertype}
24 \newcommand{\fname}[1]{\textbf{#1}}
25 \newcommand{\tabeltc}[1]{{\centering #1 \par}}
26 \newcommand{\tabelth}[1]{{\centering \textbf{\textit{#1}} \par}}
28 \newcommand{\fixme}[1]{\textbf{\textcolor{red}{#1}}}
30 \usepackage{fancyhdr}
31 \usepackage{graphicx}
32 \usepackage{verbatim}
33 \usepackage{lscape}
34 \usepackage{makeidx}
35 \usepackage{amsmath}
36 \usepackage{amssymb}
37 \usepackage{fancyvrb}
38 \usepackage{enumerate}
39 \usepackage{subfigure}
40 \usepackage{color}
41 \usepackage{booktabs}
42 \usepackage{longtable}
43 \usepackage{url}
44 \urlstyle{sf}
45 \usepackage{marvosym}
47 % fancy header style adjustments
48 %\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
49 %\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
50 \renewcommand{\rightmark}[1]{\thechapter\ }
51 \fancyhead{}
52 \fancyfoot{}
53 \fancyhead[L]{{\textsc{\leftmark}}}
54 \fancyhead[R]{\iffloatpage{}{\thepage}}
55 \fancyfoot[L]{\textsc{Rockbox users manual}}
56 \fancyfoot[R]{\textsc{\playername}}
58 \renewcommand{\headrulewidth}{\iffloatpage{0pt}{0.4pt}}
59 \renewcommand{\footrulewidth}{\iffloatpage{0pt}{0.4pt}}
60 \setlength{\headheight}{18.5pt}
61 \newcounter{example}[chapter]
63 \newenvironment{example}
64 {\stepcounter{example}\paragraph{Example \theexample:}}
65 {\hfill$\Box$
67 \bigskip
68 \noindent}
70 % found on the internet, posting by Donald Arseneau
71 % I may as well include my robust expandable definions, which can be
72 % used in \edef or \write where the \def would not be executed:
74 % \if\blank --- checks if parameter is blank (Spaces count as blank)
75 % \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
76 % \if\nil --- checks if parameter is null (spaces are NOT null)
77 % use \if\given{ } ... \else ... \fi etc.
79 {\catcode`\!=8 % funny catcode so ! will be a delimiter
80 \catcode`\Q=3 % funny catcode so Q will be a delimiter
81 \long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
82 \long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
83 \long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
84 \long\gdef\IfN@Ught#1 #2!{\blank{#2}}
85 \long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
88 % add screenshot image.
89 % Usage: \screenshot{filename}{caption}{label}
90 % Note: use this only for screenshots!
91 % Note: leave caption empty to supress it.
92 \newcommand{\screenshot}[3]{
93 \begin{figure}[!ht]
94 \begin{center}
95 \IfFileExists{#1}{\includegraphics[width=4cm]{#1}}{%
96 \typeout{Missing image: #1}%
97 \color{red}{\textbf{WARNING!} Image not found}}%
98 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{%
99 \caption{#2}}\fi
100 \end{center}
101 \end{figure}
104 % command to display a note.
105 % Usage: \note{text of your note}
106 % Note: do NOT use \textbf or similar to emphasize text, use \emph!
107 \newcommand{\note}[1]{
108 \ifinner\else\par\noindent\fi
109 \textbf{Note:}\ %
110 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Writinghand}}#1\par\fi%
113 % command to display a warning.
114 % Usage: \warn{text of your warning}
115 % Note: do NOT use \textbf or similar to emphasize text!
116 \newcommand{\warn}[1]{
117 \ifinner\else\par\noindent\fi
118 \textbf{Warning:\ }%
119 \ifinner#1\else\marginpar{\raisebox{-6pt}{\Huge\Stopsign}}#1\par\fi%