Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions doc/sphinxext/math_symbol_table.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from matplotlib import mathtext


symbols = [
["Lower-case Greek",
6,
Expand Down Expand Up @@ -112,9 +115,19 @@ def get_n(n, l):
header = " " + (('=' * max_width) + ' ') * columns
lines.append(header)
for part in get_n(columns, syms):
line = " " + " ".join(
":math:`{0}` ``{0}``".format(sym).rjust(max_width)
for sym in part)
line = (
" " +
" ".join(
"{} ``{}``".format(
sym
if not sym.startswith("\\")
else sym[1:]
if (sym[1:] in mathtext.Parser._overunder_functions
or sym[1:] in mathtext.Parser._function_names)
else chr(mathtext.tex2uni[sym[1:]]),
sym)
.rjust(max_width)
for sym in part))
lines.append(line)
lines.append(header)
lines.append('')
Expand Down
6 changes: 5 additions & 1 deletion tutorials/text/mathtext.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@

r's(t) = \mathcal{A}\/\sin(2 \omega t)'

.. Here we cheat a bit: for HTML math rendering, Sphinx relies on MathJax which
doesn't actually support the italic correction (\/); instead, use a thin
space (\,) which is supported.

.. math::

s(t) = \mathcal{A}\/\sin(2 \omega t)
s(t) = \mathcal{A}\,\sin(2 \omega t)

The choices available with all fonts are:

Expand Down