to_typst
symbolica.community.tensor Function
to_typst(expression: Expression, show_dimensions: Optional[bool] = None, *, settings: Optional[DisplaySettings] = None) -> str Produce static Typst math source.
Parameters
expressionExpressionSymbolica tensor syntax or scalar algebra to display. For a TensorExpression or component Tensor, prefer its formatting methods.
show_dimensionsbool, optionalOverride settings.show_dimensions for this call. None retains the selected settings, whose default omits dimensions.
settingsDisplaySettings, optionalTensor notation and display choices. Defaults to DisplaySettings().
Returns
str
Typst source without an enclosing document; no compilation is performed.
Notes
Only ports layout and default spacing are supported in this source format. Use to_html() or to_svg() for other layouts and custom gaps.
Static Typst output remains available independently of the HTML explorer.
Examples
from symbolica import S
expression = S("x") + 1
from symbolica.community.tensor import to_typst
output = to_typst(expression)View generated signature source: docs/api/python/spynso3.pyi:11112