File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from matplotlib import mathtext
2+
3+
14symbols = [
25 ["Lower-case Greek" ,
36 6 ,
@@ -112,9 +115,19 @@ def get_n(n, l):
112115 header = " " + (('=' * max_width ) + ' ' ) * columns
113116 lines .append (header )
114117 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 ))
118131 lines .append (line )
119132 lines .append (header )
120133 lines .append ('' )
Original file line number Diff line number Diff line change 179179
180180 r's(t) = \mathcal{A}\/\sin(2 \omega t)'
181181
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+
182186.. math::
183187
184- s(t) = \mathcal{A}\/ \sin(2 \omega t)
188+ s(t) = \mathcal{A}\, \sin(2 \omega t)
185189
186190The choices available with all fonts are:
187191
You can’t perform that action at this time.
0 commit comments