34f15b0745c046fd52f6dc4a1259e5abd2c919f4
[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 \define[0]\eg{{\em e.g.}\autoinsertnextspace}
8 \define[0]\ie{{\em i.e.}\autoinsertnextspace}
9
10
11 % Define a new reference to a definition of the term. The text of the
12 % reference is the term itself, the name is the term with def: prefixed.
13 % For example, \defref{some defined term} defines the reference named
14 % "def:some defined term" to point to this location with the text "some
15 % defined term".
16 % You can refer to this reference with refdef, e.g., 
17 % \refdef{def:some defined term}.
18 \define[1]\defref{\defreftxt{#1}{#1}}
19
20 % Define a new reference with a text different from the name, #1 is the name
21 % of the reference, #2 is the text.
22 % This automatically prefixes the reference name with def:
23 \define[2]\defreftxt{\reference[def:#1]{#2}}
24
25 % Reference a defined reference (using \defref). Will put the reference text
26 % and a page number in the margin. We use \inothermargin, since it is slightly
27 % bigger.
28 % This automatically prefixes the reference name with def:
29 \define[1]\refdef{\inothermargin{\goto{\ref[t][def:#1] p.\ref[p][def:#1]}[def:#1]}}
30
31 % Shortcuts to write in smallcaps
32 \def\VHDL{\small{VHDL}\autoinsertnextspace}
33 \def\GHC{\small{GHC}\autoinsertnextspace}