summaryrefslogtreecommitdiff
path: root/manual/preamble.tex
diff options
context:
space:
mode:
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