1414import os
1515import sys
1616import sphinx_rtd_theme
17+ import re
1718
1819
1920# -- Project information -----------------------------------------------------
2223copyright = '2020, Jesse Haviland and Peter Corke'
2324author = 'Jesse Haviland and Peter Corke'
2425
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 )
2932
3033# -- General configuration ---------------------------------------------------
3134
7578 #'github_repo': 'spatialmath-python',
7679 #'logo_name': False,
7780 'logo_only' : False ,
78- #'description': 'Spatial maths and geometry for Python',
7981 'display_version' : True ,
8082 'prev_next_buttons_location' : 'both' ,
8183 'analytics_id' : 'G-11Q6WJM565' ,
111113 # 'fncychap': '\\usepackage[Lenny]{fncychap}',
112114 'fncychap' : '\\ usepackage{fncychap}' ,
113115 '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+ }
114153}
0 commit comments