Improve Normalization chapter a bit.
[matthijs/master-project/report.git] / Utils / Shortcuts.tex
1 %
2 % This file defines some useful shortcut commands
3 %
4
5
6 % A shortcut for italicized e.g. and i.e.
7 % TODO: Prevent this macro from globbing the following space
8 \define[0]\eg{{\em e.g.}}
9 \define[0]\ie{{\em i.e.}}
10
11
12 % Define a new reference to a definition of the term. The text of the
13 % reference is the term itself, the name is the term with def: prefixed.
14 % For example, \defref{some defined term} defines the reference named
15 % "def:some defined term" to point to this location with the text "some
16 % defined term".
17 % You can refer to this reference with refdef, e.g., 
18 % \refdef{def:some defined term}.
19 \define[1]\defref{\defreftxt{#1}{#1}}
20
21 % Define a new reference with a text different from the name, #1 is the name
22 % of the reference, #2 is the text.
23 % This automatically prefixes the reference name with def:
24 \define[2]\defreftxt{\reference[def:#1]{#2}}
25
26 % Reference a defined reference (using \defref). Will put the reference text
27 % and a page number in the margin. We use \inothermargin, since it is slightly
28 % bigger.
29 % This automatically prefixes the reference name with def:
30 \define[1]\refdef{\inothermargin{\goto{\ref[t][def:#1] p.\ref[p][def:#1]}[def:#1]}}