summaryrefslogtreecommitdiff
path: root/manual/preamble.tex
diff options
context:
space:
mode:
authorMartin Arver <martin.arver@gmail.com>2006-03-30 15:54:47 +0000
committerMartin Arver <martin.arver@gmail.com>2006-03-30 15:54:47 +0000
commitcbc559980efaeb3120f555308fc73f291a814a08 (patch)
tree99cf6d0649adda2bb8f0679598e89c356ccfdc10 /manual/preamble.tex
parent44b76bc4fa965d1a08c6b27154e8b6a6f1ceff67 (diff)
downloadrockbox-cbc559980efaeb3120f555308fc73f291a814a08.tar.gz
rockbox-cbc559980efaeb3120f555308fc73f291a814a08.zip
Patch #4958 from Dominik Riebeling (bluebrother). Adds a new \screenshot macro to be used when including screenshots. Look at the rockbox_interface/main.tex for examples on how to use it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9359 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'manual/preamble.tex')
-rw-r--r--manual/preamble.tex31
1 files changed, 31 insertions, 0 deletions
diff --git a/manual/preamble.tex b/manual/preamble.tex
index d76fe9f44c..40fd60118e 100644
--- a/manual/preamble.tex
+++ b/manual/preamble.tex
@@ -64,4 +64,35 @@
64 \bigskip 64 \bigskip
65 \noindent} 65 \noindent}
66 66
67% found on the internet, posting by Donald Arseneau
68% I may as well include my robust expandable definions, which can be
69% used in \edef or \write where the \def would not be executed:
70%
71% \if\blank --- checks if parameter is blank (Spaces count as blank)
72% \if\given --- checks if parameter is not blank: like \if\blank{#1}\else
73% \if\nil --- checks if parameter is null (spaces are NOT null)
74% use \if\given{ } ... \else ... \fi etc.
75%
76{\catcode`\!=8 % funny catcode so ! will be a delimiter
77\catcode`\Q=3 % funny catcode so Q will be a delimiter
78\long\gdef\given#1{88\fi\Ifbl@nk#1QQQ\empty!}
79\long\gdef\blank#1{88\fi\Ifbl@nk#1QQ..!}% if null or spaces
80\long\gdef\nil#1{\IfN@Ught#1* {#1}!}% if null
81\long\gdef\IfN@Ught#1 #2!{\blank{#2}}
82\long\gdef\Ifbl@nk#1#2Q#3!{\ifx#3}% same as above
83}
84
85% add screenshot image.
86% Usage: \screenshot{filename}{caption}{label}
87% Note: use this only for screenshots!
88% Note: leave caption empty to supress it.
89\newcommand{\screenshot}[3]{
90 \begin{figure}[!ht]
91 \begin{center}
92 \includegraphics[width=4cm]{#1}
93 \if\blank{#3}\else{\label{#3}}\fi\if\blank{#2}\else{
94 \caption{#2}}\fi
95 \end{center}
96 \end{figure}
97}
67 98