14
14
import os
15
15
import sys
16
16
import sphinx_rtd_theme
17
+ import re
17
18
18
19
19
20
# -- Project information -----------------------------------------------------
22
23
copyright = '2020, Jesse Haviland and Peter Corke'
23
24
author = 'Jesse Haviland and Peter Corke'
24
25
25
- print (__file__ )
26
- # The full version, including alpha/beta/rc tags
27
- with open ('../../RELEASE' , encoding = 'utf-8' ) as f :
28
- release = f .read ()
26
+ # print(__file__)
27
+
28
+ # parse version number out of setup.py
29
+ with open ('../../setup.py' , encoding = 'utf-8' ) as f :
30
+ setup_py = f .read ()
31
+ m = re .search ("version='([0-9\.]*)'," , setup_py , re .MULTILINE )
29
32
30
33
# -- General configuration ---------------------------------------------------
31
34
75
78
#'github_repo': 'spatialmath-python',
76
79
#'logo_name': False,
77
80
'logo_only' : False ,
78
- #'description': 'Spatial maths and geometry for Python',
79
81
'display_version' : True ,
80
82
'prev_next_buttons_location' : 'both' ,
81
83
'analytics_id' : 'G-11Q6WJM565' ,
111
113
# 'fncychap': '\\usepackage[Lenny]{fncychap}',
112
114
'fncychap' : '\\ usepackage{fncychap}' ,
113
115
'maketitle' : "blah blah blah"
116
+ }
117
+
118
+ # see https://stackoverflow.com/questions/9728292/creating-latex-math-macros-within-sphinx
119
+ mathjax_config = {
120
+ 'TeX' : {
121
+ 'Macros' : {
122
+ # RVC Math notation
123
+ # - not possible to do the if/then/else approach
124
+ # - subset only
125
+ "presup" : [r"\,{}^{\scriptscriptstyle #1}\!" , 1 ],
126
+ # groups
127
+ "SE" : [r"\mathbf{SE}(#1)" , 1 ],
128
+ "SO" : [r"\mathbf{SO}(#1)" , 1 ],
129
+ "se" : [r"\mathbf{se}(#1)" , 1 ],
130
+ "so" : [r"\mathbf{so}(#1)" , 1 ],
131
+ # vectors
132
+ "vec" : [r"\boldsymbol{#1}" , 1 ],
133
+ "dvec" : [r"\dot{\boldsymbol{#1}}" , 1 ],
134
+ "ddvec" : [r"\ddot{\boldsymbol{#1}}" , 1 ],
135
+ "fvec" : [r"\presup{#1}\boldsymbol{#2}" , 2 ],
136
+ "fdvec" : [r"\presup{#1}\dot{\boldsymbol{#2}}" , 2 ],
137
+ "fddvec" : [r"\presup{#1}\ddot{\boldsymbol{#2}}" , 2 ],
138
+ "norm" : [r"\Vert #1 \Vert" , 1 ],
139
+ # matrices
140
+ "mat" : [r"\mathbf{#1}" , 1 ],
141
+ "fmat" : [r"\presup{#1}\mathbf{#2}" , 2 ],
142
+ # skew matrices
143
+ "sk" : [r"\left[#1\right]" , 1 ],
144
+ "skx" : [r"\left[#1\right]_{\times}" , 1 ],
145
+ "vex" : [r"\vee\left( #1\right)" , 1 ],
146
+ "vexx" : [r"\vee_{\times}\left( #1\right)" , 1 ],
147
+ # quaternions
148
+ "q" : r"\mathring{q}" ,
149
+ "fq" : [r"\presup{#1}\mathring{q}" , 1 ],
150
+
151
+ }
152
+ }
114
153
}
0 commit comments