@@ -81,7 +81,65 @@ def add_source_parser(_old_add_source_parser, self, *args, **kwargs):
81
81
nbsphinx_kernel_name = 'python'
82
82
nbsphinx_timeout = 60
83
83
84
- # -- extensions configuration ---------------------------------------------------
84
+ # -- latex configuration ---------------------------------------------------
85
+
86
+ galgebra_latex_macros = R"""
87
+ \newcommand{\bm}[1]{\boldsymbol{#1}}
88
+ \newcommand{\ubh}{\bm{\hat{u}}}
89
+ \newcommand{\ebh}{\bm{\hat{e}}}
90
+ \newcommand{\ebf}{\bm{e}}
91
+ \newcommand{\mat}[1]{\left [ {#1} \right ]}
92
+ \newcommand{\bra}[1]{{#1}_{\mathcal{G}}}
93
+ \newcommand{\ket}[1]{{#1}_{\mathcal{D}}}
94
+ \newcommand{\ds}{\displaystyle}
95
+ \newcommand{\bfrac}[2]{\displaystyle\frac{#1}{#2}}
96
+ \newcommand{\lp}{\left (}
97
+ \newcommand{\rp}{\right )}
98
+ \newcommand{\half}{\frac{1}{2}}
99
+ \newcommand{\llt}{\left <}
100
+ \newcommand{\rgt}{\right >}
101
+ \newcommand{\abs}[1]{\left |{#1}\right |}
102
+ \newcommand{\pdiff}[2]{\bfrac{\partial {#1}}{\partial {#2}}}
103
+ \newcommand{\pdifftwo}[3]{\bfrac{\partial^{2} {#1}}{\partial {#2}\partial {#3}}}
104
+ \newcommand{\lbrc}{\left \{}
105
+ \newcommand{\rbrc}{\right \}}
106
+ \newcommand{\set}[1]{\lbrc {#1} \rbrc}
107
+ \newcommand{\W}{\wedge}
108
+ \newcommand{\R}{\dagger}
109
+ \newcommand{\lbrk}{\left [}
110
+ \newcommand{\rbrk}{\right ]}
111
+ \newcommand{\com}[1]{\lbrk {#1} \rbrk}
112
+ \newcommand{\proj}[2]{\llt {#1} \rgt_{#2}}
113
+ %\newcommand{\bm}{\boldsymbol}
114
+ \newcommand{\braces}[1]{\left \{ {#1} \right \}}
115
+ \newcommand{\grade}[1]{\left < {#1} \right >}
116
+ \newcommand{\f}[2]{{#1}\lp {#2} \rp }
117
+ \newcommand{\paren}[1]{\lp {#1} \rp }
118
+ \newcommand{\eval}[2]{\left . {#1} \right |_{#2}}
119
+ \newcommand{\prm}[1]{{#1}'}
120
+ \newcommand{\ddt}[1]{\bfrac{d{#1}}{dt}}
121
+ \newcommand{\deriv}[3]{\bfrac{d^{#3}#1}{d{#2}^{#3}}}
122
+ \newcommand{\be}{\begin{equation}}
123
+ \newcommand{\ee}{\end{equation}}
124
+ \newcommand{\eb}{\bm{e}}
125
+ \newcommand{\ehb}{\bm{\hat{e}}}
126
+ \newcommand{\Tn}[2]{\f{\mathcal{T}_{#2}}{#1}}
127
+ \newcommand{\tr}{\mbox{tr}}
128
+ \newcommand{\T}[1]{\texttt{#1}}
129
+ \newcommand{\grd}{\bm{\nabla}}
130
+ \newcommand{\indices}[1]{#1}
131
+ \newcommand{\xRightarrow}[1]{\overset{#1}{\Rightarrow}}
132
+ """
133
+
134
+ # enable autonumbering
135
+ mathjax_config = dict (TeX = dict (
136
+ equationNumbers = dict (autoNumber = "AMS" ),
137
+ extensions = ["[Contrib]/preamble/preamble.js" ],
138
+ preamble = [galgebra_latex_macros ]
139
+ ))
140
+
141
+
142
+ # -- other extension configuration --------------------------------------------
85
143
86
144
napoleon_include_init_with_doc = False
87
145
@@ -211,7 +269,7 @@ def add_source_parser(_old_add_source_parser, self, *args, **kwargs):
211
269
212
270
# Additional stuff for the LaTeX preamble.
213
271
#
214
- # 'preamble': '' ,
272
+ 'preamble' : galgebra_latex_macros ,
215
273
216
274
# Latex figure (float) alignment
217
275
#
0 commit comments