Convert LaTex maths code into presentational MathML.
This module is provisional: the API is not settled and may change with any minor Docutils version.
Class | math |
Base class for MathML elements and root of MathML trees. |
Class | MathRowSchema |
Base class for elements treating content as a single inferred mrow. |
Class | MathSchema |
Base class for schemata expecting 2 or more children. |
Class | MathToken |
Token Element: contains textual data instead of children. |
Class | menclose |
Undocumented |
Class | mfrac |
Undocumented |
Class | mi |
Undocumented |
Class | mn |
Undocumented |
Class | mo |
Undocumented |
Class | mover |
Undocumented |
Class | mphantom |
Undocumented |
Class | mroot |
Undocumented |
Class | mrow |
Group sub-expressions as a horizontal row. |
Class | mspace |
Undocumented |
Class | msqrt |
Undocumented |
Class | mstyle |
Undocumented |
Class | msub |
Undocumented |
Class | msubsup |
Undocumented |
Class | msup |
Undocumented |
Class | mtable |
Undocumented |
Class | mtd |
Undocumented |
Class | mtext |
Undocumented |
Class | mtr |
Undocumented |
Class | munder |
Undocumented |
Class | munderover |
Undocumented |
Function | align_attributes |
Undocumented |
Function | begin_environment |
Undocumented |
Function | end_environment |
Undocumented |
Function | handle_cmd |
Process LaTeX command name followed by string . |
Function | handle_script_or_limit |
Append script or limit element to node . |
Function | parse_latex_math |
Append MathML conversion of string to node and return it. |
Function | tex2mathml |
Return string with MathML code corresponding to tex_math . |
Function | tex_cmdname |
Return leading TeX command name and remainder of string . |
Function | tex_equation_columns |
Undocumented |
Function | tex_group |
Return first TeX group or token and remainder of string . |
Function | tex_number |
Return leading number literal and remainder of string . |
Function | tex_optarg |
Return optional argument and remainder. |
Function | tex_token |
Return first simple TeX token and remainder of string . |
Function | tex_token_or_group |
Return first TeX group or token and remainder of string . |
Variable | accents |
Undocumented |
Variable | anomalous_chars |
Undocumented |
Variable | bigdelimiters |
Undocumented |
Variable | delimiter_sizes |
Undocumented |
Variable | fractions |
Undocumented |
Variable | functions |
Undocumented |
Variable | greek_capitals |
Undocumented |
Variable | layout_styles |
Undocumented |
Variable | math_alphabets |
Undocumented |
Variable | mathbb |
Undocumented |
Variable | matrices |
Undocumented |
Variable | movablelimits |
Undocumented |
Variable | operators |
Undocumented |
Variable | over |
Undocumented |
Variable | small_operators |
Undocumented |
Variable | spaces |
Undocumented |
Variable | stretchables |
Undocumented |
Variable | thick_operators |
Undocumented |
Variable | under |
Undocumented |
Process LaTeX command name
followed by string
.
Append result to node
.
If needed, parse string
for command argument.
Return new current node and remainder of string
:
>>> handle_cmd('hbar', math(), r' rac') (math(mi('ℏ')), ' \frac') >>> handle_cmd('hspace', math(), r'{1ex} (x)') (math(mspace(width='1ex')), ' (x)')
Append MathML conversion of string
to node
and return it.
>>> parse_latex_math(math(), r'\x07lpha') math(mi('α')) >>> parse_latex_math(mrow(), r'x_{n}') mrow(msub(mi('x'), mi('n')))
Return string with MathML code corresponding to tex_math
.
Set inline
to False for displayed math.
Return leading TeX command name and remainder of string
.
>>> tex_cmdname('mymacro2') # up to first non-letter ('mymacro', '2') >>> tex_cmdname('name 2') # strip trailing whitespace ('name', '2') >>> tex_cmdname('_2') # single non-letter character ('_', '2')
Return first TeX group or token and remainder of string
.
>>> tex_group('{first group} returned without brackets') ('first group', ' returned without brackets')
Return leading number literal and remainder of string
.
>>> tex_number('123.4') ('123.4', '')
Return optional argument and remainder.
>>> tex_optarg('[optional argument] returned without brackets') ('optional argument', ' returned without brackets') >>> tex_optarg('{empty string, if there is no optional arg}') ('', '{empty string, if there is no optional arg}')
Return first simple TeX token and remainder of string
.
>>> tex_token('\command{without argument}') ('\command', '{without argument}') >>> tex_token('or first character') ('o', 'r first character')
Return first TeX group or token and remainder of string
.
>>> tex_token_or_group('\command{without argument}') ('\command', '{without argument}') >>> tex_token_or_group('first character') ('f', 'irst character') >>> tex_token_or_group(' also whitespace') (' ', 'also whitespace') >>> tex_token_or_group('{first group} keep rest') ('first group', ' keep rest')