-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20-math.tex
85 lines (66 loc) · 3.79 KB
/
20-math.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
% Provides: Mathematical packages, symbols, notation and shortcuts.
% You will almost always need this, because, why would you write something else than math. ;-)
% Requires: xspace
%% Packages
% For ‘DeclareMathOperator’-command, various alignment-environments (e.g. align, split, gather …),
% better spacing around equality-signs, and many more. In short: indispensible.
\usepackage{amsmath}
% For better theorem-like-environments. Also defines a proof-environment.
% Must be loaded after amsmath.
\usepackage{amsthm}
% Many more math symbols like \nsubseteq, \mapsto, \nexists, \hat{…} and many more.
% Also the \mathbb{…} command for ‘blackboard boald’ character used for sets of numbers.
% Implicitly loads amsfonts, “An extended set of fonts for use in mathematics […]”.
\usepackage{amssymb}
% Some more typesetting like ‘DeclarePairedDelimiter’, ‘\begin{cases}’,‘\overbrace{}’, ‘\mathclap{}’, …
% (the latter is useful for reducing whitespaces that can occur in subscripts or exponents.)
\usepackage{mathtools}
% More symbols like \lighning, \bigsqcap and the \llbracket \rrbracket delimiter pair
\usepackage{stmaryrd}
% For negating (strike-through) of own symbols.
% \centernot works like \not, but a bit better for wider symbols.
\usepackage{centernot}
% For cancelling terms.
% Defines \cancel{term}, \bcancel{term} (backwards, i.e. the other diagonal), \xcancel{term}
% and \cancelto{value}{term} (cancel with an arrow to the value)
\usepackage{cancel}
% Customize the font styles.
% ‘dsserif’ for \mathbb also supports digits, e.g. for a unit vector: \mathbb{1}.
\usepackage[cal=cm,
scr=rsfso,
% lucida fraktur is under commercial license, unfortunately
frak=euler,
bb=dsserif]{mathalpha}
% ~~~~ I tried using the ‘unicode-math’-package, but there were just too many problems, warnings and bugs (e.g. no \setminus in many fonts).
% ~~~~ Maybe look into this again in a few years.
% Redefines many math symbols to unicode.
% Also allows \mathbb{1}
% Should be ok to ignore these warnings, but have a closer look if there is a problem with ‘\…colon…’-commands, e.g. \coloneqq.
%\usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math}
%\setmathfont{Stix Two Math}
%\setmathfont{ConcreteMath}[range={cal, bfcal}]
%\setmathfont{Stix Two Math}[range={scr, bfscr}, StylisticSet=1]
%% Symbol definitions
\newcommand{\quantor}{\mathord{\reflectbox{\ensuremath{Q}}}} % the generic quantor
\NewDocumentCommand{\blankcell}{}{\ensuremath{\centernot b}} % empty cell symbol of Turing machines
\NewDocumentCommand{\questioneq}{}{\stackrel{\text{?}}{=}} % = with a ‘?’ on top
\NewDocumentCommand{\defeq}{}{\stackrel{\text{def.}}{=}} % equal by definition
\NewDocumentCommand{\contra}{}{\scalebox{1.25}{\lightning}} % lightning symbol for contradiction
\NewDocumentCommand{\st}{m}{\mathrel{}\middle#1\mathinner{}} % growing middle in left/right-delimiter bracket with relational spacing (like \mid)
% this answer https://tex.stackexchange.com/a/5550 suggestes \mathrel{} also for the space after the |
% but for some reason this does not seem to work
%% Numbers
\NewDocumentCommand{\N}{}{\ensuremath{\mathbb{N}}\xspace}
\NewDocumentCommand{\Z}{}{\ensuremath{\mathbb{Z}}\xspace}
\NewDocumentCommand{\Q}{}{\ensuremath{\mathbb{Q}}\xspace}
\NewDocumentCommand{\R}{}{\ensuremath{\mathbb{R}}\xspace}
\NewDocumentCommand{\C}{}{\ensuremath{\mathbb{C}}\xspace}
% use this for multi-letter variables/
\newcommand{\var}[1]{\ensuremath{\mathrm{#1}}}
\newcommand{\func}[1]{\operatorname{#1}}
% MathOperator with a ‘*’ allows for ‘lim’-like notation with limits below in display math mode.
% \max, \min, \sup, \inf are already pre-defined by amsmath
\DeclareMathOperator*{\argmax}{arg\,max}
\DeclareMathOperator*{\argmin}{arg\,min}
% File has been loaded.
\toggletrue{20-math}