Skip to content

Commit 664f36f

Browse files
committed
add RVC macros for MathJax
1 parent 3b9eff4 commit 664f36f

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

docs/source/conf.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,43 @@
109109
'fncychap': '\\usepackage{fncychap}',
110110
}
111111

112+
# see https://stackoverflow.com/questions/9728292/creating-latex-math-macros-within-sphinx
113+
mathjax_config = {
114+
'TeX': {
115+
'Macros': {
116+
# RVC Math notation
117+
# - not possible to do the if/then/else approach
118+
# - subset only
119+
"presup": [r"\,{}^{\scriptscriptstyle #1}\!", 1],
120+
# groups
121+
"SE": [r"\mathbf{SE}(#1)", 1],
122+
"SO": [r"\mathbf{SO}(#1)", 1],
123+
"se": [r"\mathbf{se}(#1)", 1],
124+
"so": [r"\mathbf{so}(#1)", 1],
125+
# vectors
126+
"vec": [r"\boldsymbol{#1}", 1],
127+
"dvec": [r"\dot{\boldsymbol{#1}}", 1],
128+
"ddvec": [r"\ddot{\boldsymbol{#1}}", 1],
129+
"fvec": [r"\presup{#1}\boldsymbol{#2}", 2],
130+
"fdvec": [r"\presup{#1}\dot{\boldsymbol{#2}}", 2],
131+
"fddvec": [r"\presup{#1}\ddot{\boldsymbol{#2}}", 2],
132+
"norm": [r"\Vert #1 \Vert", 1],
133+
# matrices
134+
"mat": [r"\mathbf{#1}", 1],
135+
"fmat": [r"\presup{#1}\mathbf{#2}", 2],
136+
# skew matrices
137+
"sk": [r"\left[#1\right]", 1],
138+
"skx": [r"\left[#1\right]_{\times}", 1],
139+
"vex": [r"\vee\left( #1\right)", 1],
140+
"vexx": [r"\vee_{\times}\left( #1\right)", 1],
141+
# quaternions
142+
"q": r"\mathring{q}",
143+
"fq": [r"\presup{#1}\mathring{q}", 1],
144+
145+
}
146+
}
147+
}
148+
112149
autorun_languages = {}
113150
autorun_languages['pycon_output_encoding'] = 'UTF-8'
114151
autorun_languages['pycon_input_encoding'] = 'UTF-8'

0 commit comments

Comments
 (0)