-
Notifications
You must be signed in to change notification settings - Fork 15
/
macrosetup.tex
executable file
·50 lines (41 loc) · 1.65 KB
/
macrosetup.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
%% Custom commands
%% ===============
%% Special characters for number sets, e.g. real or complex numbers.
\newcommand{\C}{\mathbb{C}}
\newcommand{\K}{\mathbb{K}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\X}{\mathbb{X}}
% surrounding every content with the math environment does make the content copyable from the pdf document back into latex form. In some cases for example in captions or section titles, you will need to add \protect before the printlatex command, otherwise you get a strange error about a } too many.
%Usage:: \(\printlatex{2^i}\) or \(\pl{2^i}\) as shorthand
\newcommand*{\printlatex}[1]{%
\BeginAccSupp{%
ActualText=\detokenize{#1},%
method=escape,
}%
#1%
\EndAccSupp{}%
}
\newcommand{\pl}[1]{\printlatex{#1}}
\newcommand{\mc}[1]{\mathcal{#1}}
%% Special characters for Expected value |E , Variance \V, \I, Prediction error \predR
\newcommand{\E}{\mathbb{E}}
\newcommand{\V}{\mathbb{V}}
\newcommand{\I}{\mathbb{I}}
\newcommand{\predR}{\mathcal{R}}
%% Fixed/scaling delimiter examples (see mathtools documentation)
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
%% Use the alternative epsilon per default and define the old one as \oldepsilon
\let\oldepsilon\epsilon
\renewcommand{\epsilon}{\ensuremath\varepsilon}
%% Also set the alternate phi as default.
%\let\oldphi\phi
%\renewcommand{\phi}{\ensuremath{\varphi}}
%% create the signum function for mathematical formulas
\newcommand{\sgn}{\operatorname{sgn}}
\DeclareMathOperator*{\xpt}{\textit{E}}
\newcommand{\argmin}{\arg\!\min}
\newcommand{\argmax}{\arg\!\max}