-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreamble.sty
93 lines (76 loc) · 1.94 KB
/
preamble.sty
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
86
87
88
89
90
91
\newcommand{\typing}[3][\Gamma]{#1 \vdash #2 : #3}
\require{physics}
\require{mathtools}
\newcommand{\ind}[2]{^{#1}_{\phantom{#1}#2}} % for nice tensor indices
\newcommand{\invind}[2]{_{#1}^{\phantom{#1}#2}} % covariant before contravariant indices
\newcommand{\F}{\vec{F}}
\newcommand{\x}{\vec{x}}
\renewcommand{\r}{\vec{r}}
\newcommand{\p}{\vec{p}}
\renewcommand{\v}{\vec{v}}
\newcommand{\e}{\hat{e}}
\newcommand{\D}{\mathrm{D}}
\newcommand{\im}{\iunit}
\renewcommand{\L}{\mathcal{L}}
\require{color}
\definecolor{light-yellow}{rgb}{1,0.98,0.77}
\definecolor{light-green}{rgb}{.77,0.88,0.65}
\definecolor{light-blue}{rgb}{.75,0.87,0.98}
\definecolor{light-purple}{rgb}{.88,0.75,0.91}
\definecolor{light-orange}{rgb}{1,0.88,0.7}
\definecolor{light-red}{rgb}{.94,0.6,0.6}
\newcommand{\hy}[1]{%
\colorbox{light-yellow}{$\displaystyle#1$}}
\newcommand{\hg}[1]{%
\colorbox{light-green}{$\displaystyle#1$}}
\newcommand{\hb}[1]{%
\colorbox{light-blue}{$\displaystyle#1$}}
\newcommand{\hp}[1]{%
\colorbox{light-purple}{$\displaystyle#1$}}
\newcommand{\ho}[1]{%
\colorbox{light-orange}{$\displaystyle#1$}}
\newcommand{\hr}[1]{%
\colorbox{light-red}{$\displaystyle#1$}}
\hr{test}
\newcommand{\iunit}{{\mathring{\imath}}}
\NewCommand{\tens}{mo}
{
#1
\IfNoValueTF { #2 }
{
\__myridium_tens_up_lookup:
}
{
\__myridium_tens_down_lookup: [ #2 ]
}
}
\cs_new_protected:Nn \__myridium_tens_down_lookup:
{
\peek_charcode_ignore_spaces:NTF [
{
\__myridium_tens_down:w
}
{ \kern2\scriptspace }
}
\cs_new_protected:Npn \__myridium_tens_down:w [ #1 ]
{
{\mathstrut}
\sb{#1}
\kern-\scriptspace
\__myridium_tens_up_lookup:
}
\cs_new_protected:Nn \__myridium_tens_up_lookup:
{
\peek_catcode_ignore_spaces:NTF \c_group_begin_token
{
\__myridium_tens_up:n
}
{ \kern2\scriptspace }
}
\cs_new_protected:Nn \__myridium_tens_up:n
{
{\mathstrut}
\sp{#1}
\kern-\scriptspace
\__myridium_tens_down_lookup:
}