io#

import ampform.io

Input-output functions for ampform and sympy objects.

Tip

This function are registered with functools.singledispatch() and can be extended as follows:

>>> from ampform.io import aslatex
>>> @aslatex.register(int)
... def _(obj: int) -> str:
...     return "my custom rendering"
>>> aslatex(1)
'my custom rendering'
>>> aslatex(3.4 - 2j)
'3.4-2i'
aslatex(obj) str[source]#
aslatex(obj: complex) str
aslatex(obj: Basic) str
aslatex(obj: Mapping) str
aslatex(obj: Iterable) str

Render objects as a LaTeX str.

The resulting str can for instance be given to IPython.display.Math.

improve_latex_rendering() None[source]#

Improve LaTeX rendering of an Indexed object.