![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Functions | |
| tex_cmdname (string) | |
| tex_number (string) | |
| tex_token (string) | |
| tex_group (string) | |
| tex_token_or_group (string) | |
| tex_optarg (string) | |
| parse_latex_math (root, source) | |
| handle_cmd (name, node, string) | |
| handle_math_alphabet (name, node, string) | |
| handle_script_or_limit (node, c, limits='') | |
| begin_environment (node, string) | |
| end_environment (node, string) | |
| tex_equation_columns (rows) | |
| align_attributes (rows) | |
| tex2mathml (tex_math, as_block=False) | |
Variables | |
| dict | letters = {'hbar': 'ℏ'} |
| ordinary = tex2unichar.mathord | |
| dict | greek_capitals |
| dict | functions |
| dict | modulo_functions |
| dict | math_alphabets |
| dict | stretchables |
| dict | operators |
| dict | thick_operators |
| dict | small_operators |
| tuple | movablelimits |
| dict | spaces |
| dict | accents |
| dict | over |
| dict | under |
| dict | anomalous_chars |
| dict | mathbb |
| dict | matrices |
| dict | layout_styles |
| dict | fractions |
| list | delimiter_sizes = ['', '1.2em', '1.623em', '2.047em', '2.470em'] |
| dict | bigdelimiters |
Convert LaTex maths code into presentational MathML. This module is provisional: the API is not settled and may change with any minor Docutils version.
| docutils.utils.math.latex2mathml.handle_cmd | ( | name, | |
| node, | |||
| string | |||
| ) |
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' \frac')
(math(mi('ℏ')), ' \\frac')
>>> handle_cmd('hspace', math(), r'{1ex} (x)')
(math(mspace(width='1ex')), ' (x)')
| docutils.utils.math.latex2mathml.handle_script_or_limit | ( | node, | |
| c, | |||
limits = '' |
|||
| ) |
Append script or limit element to `node`.
| docutils.utils.math.latex2mathml.parse_latex_math | ( | root, | |
| source | |||
| ) |
Append MathML conversion of `string` to `node` and return it.
>>> parse_latex_math(math(), r'\alpha')
math(mi('α'))
>>> parse_latex_math(mrow(), r'x_{n}')
mrow(msub(mi('x'), mi('n')))
| docutils.utils.math.latex2mathml.tex2mathml | ( | tex_math, | |
as_block = False |
|||
| ) |
Return string with MathML code corresponding to `tex_math`. Set `as_block` to ``True`` for displayed formulas.
| docutils.utils.math.latex2mathml.tex_cmdname | ( | string | ) |
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')
| docutils.utils.math.latex2mathml.tex_group | ( | string | ) |
Return first TeX group or token and remainder of `string`.
>>> tex_group('{first group} returned without brackets')
('first group', ' returned without brackets')
| docutils.utils.math.latex2mathml.tex_number | ( | string | ) |
Return leading number literal and remainder of `string`.
>>> tex_number('123.4')
('123.4', '')
| docutils.utils.math.latex2mathml.tex_optarg | ( | string | ) |
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}')
| docutils.utils.math.latex2mathml.tex_token | ( | string | ) |
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')
| docutils.utils.math.latex2mathml.tex_token_or_group | ( | string | ) |
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')
| dict docutils.utils.math.latex2mathml.accents |
| dict docutils.utils.math.latex2mathml.anomalous_chars |
| dict docutils.utils.math.latex2mathml.bigdelimiters |
| dict docutils.utils.math.latex2mathml.fractions |
| dict docutils.utils.math.latex2mathml.functions |
| dict docutils.utils.math.latex2mathml.greek_capitals |
| dict docutils.utils.math.latex2mathml.layout_styles |
| dict docutils.utils.math.latex2mathml.math_alphabets |
| dict docutils.utils.math.latex2mathml.mathbb |
| dict docutils.utils.math.latex2mathml.matrices |
| dict docutils.utils.math.latex2mathml.modulo_functions |
| tuple docutils.utils.math.latex2mathml.movablelimits |
| dict docutils.utils.math.latex2mathml.operators |
| dict docutils.utils.math.latex2mathml.over |
| dict docutils.utils.math.latex2mathml.small_operators |
| dict docutils.utils.math.latex2mathml.spaces |
| dict docutils.utils.math.latex2mathml.stretchables |
| dict docutils.utils.math.latex2mathml.thick_operators |
| dict docutils.utils.math.latex2mathml.under |