File tree 2 files changed +21
-4
lines changed 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change
1
+ from matplotlib import mathtext
2
+
3
+
1
4
symbols = [
2
5
["Lower-case Greek" ,
3
6
6 ,
@@ -112,9 +115,19 @@ def get_n(n, l):
112
115
header = " " + (('=' * max_width ) + ' ' ) * columns
113
116
lines .append (header )
114
117
for part in get_n (columns , syms ):
115
- line = " " + " " .join (
116
- ":math:`{0}` ``{0}``" .format (sym ).rjust (max_width )
117
- for sym in part )
118
+ line = (
119
+ " " +
120
+ " " .join (
121
+ "{} ``{}``" .format (
122
+ sym
123
+ if not sym .startswith ("\\ " )
124
+ else sym [1 :]
125
+ if (sym [1 :] in mathtext .Parser ._overunder_functions
126
+ or sym [1 :] in mathtext .Parser ._function_names )
127
+ else chr (mathtext .tex2uni [sym [1 :]]),
128
+ sym )
129
+ .rjust (max_width )
130
+ for sym in part ))
118
131
lines .append (line )
119
132
lines .append (header )
120
133
lines .append ('' )
Original file line number Diff line number Diff line change 179
179
180
180
r's(t) = \mathcal{A}\/\sin(2 \omega t)'
181
181
182
+ .. Here we cheat a bit: for HTML math rendering, Sphinx relies on MathJax which
183
+ doesn't actually support the italic correction (\/); instead, use a thin
184
+ space (\,) which is supported.
185
+
182
186
.. math::
183
187
184
- s(t) = \mathcal{A}\/ \sin(2 \omega t)
188
+ s(t) = \mathcal{A}\, \sin(2 \omega t)
185
189
186
190
The choices available with all fonts are:
187
191
You can’t perform that action at this time.
0 commit comments