Merge pull request #102 from sebix/ignoretmp
[ach-master.git] / src / common / commands.tex
1 %%%
2 %%% commands.tex
3 %%% Document-specific commands
4 %%%
5
6 % Outputs red TODOs in the document. Requires \usepackage{color}.
7 %
8 % Usage: \todo{Document the TODO command.}
9 %
10 % Comment out second line to disable.
11 \AtBeginDocument{\providecommand{\todo}[1]{}}
12 \newcommand*{\todo}[1]{{\color{Red} TODO: {#1}}}
13
14 % Creating a horizontal rule
15 \newcommand*{\HorRule}{%
16   \color{darkblue}%
17   \rule{\linewidth}{1pt}%
18 }
19
20 %%% CIPHERSTRING
21 \usepackage{seqsplit} % Use Sequence split. Basically it inserts between every character pair a box with zero width to allow linebreaks everywhere. Better solution wanted, but is there any better?
22 \CatchFileDef{\cipherStringB}{common/cipherStringB.tex}{\endlinechar=-1 }%
23
24 \newcommand\warningbox[1]{
25 \par\leavevmode\noindent%
26 \fcolorbox{black}{pink!20}{\parbox{.99\linewidth}{%
27 \begingroup
28 \vspace*{.2\baselineskip}%
29 \addtolength{\textwidth}{-.4\baselineskip}
30   #1%
31 \vspace*{.2\baselineskip}%
32 \endgroup
33 }}\par}
34
35 \newcommand\ttbox[1]{
36 \par\leavevmode\noindent%
37 \fcolorbox{black}{black!10}{\parbox{.99\linewidth}{%
38     \texttt{#1}%
39 }}}
40
41 \newcommand*\doindex[2][]{%
42   \newterm[name={#2},#1]{index-#2}%
43 }
44 \catcode`|=\active
45 \makeatletter
46 \def\idxopt[#1]#2|{\idx[#1]{#2}\xspace}
47 \def\idxnorm#1|{%
48   \def\tempa{#1}%
49   \ifx\tempa\@empty%
50     \textbar\relax%
51   \else%
52     \idx{#1}\xspace% 
53   \fi%
54 }
55 \def|{\@ifnextchar[{\idxopt}{\idxnorm}%]
56 }
57 \makeatother
58 \newcommand*\idx[2][]{\gls[#1]{index-#2}}
59 \newcommand*\Idx[2][]{\Gls[#1]{index-#2}}
60 \newcommand*\IDX[2][]{\GLS[#1]{index-#2}}
61 \newcommand*\idxpl[2][]{\glspl[#1]{index-#2}}
62 \newcommand*\Idxpl[2][]{\Glspl[#1]{index-#2}}
63 \newcommand*\IDXpl[2][]{\GLSpl[#1]{index-#2}}
64 \newcommand*\alsoidx[1]{\glsadd{index-#1}}
65
66 %%% Local Variables: 
67 %%% mode: latex
68 %%% TeX-master: "../applied-crypto-hardening"
69 %%% End: