Idenso · latest
On this page

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

expression Expression

Symbolica tensor syntax or scalar algebra to display. For a TensorExpression or component Tensor, prefer its formatting methods.

show_dimensions bool, optional

Override settings.show_dimensions for this call. None retains the selected settings, whose default omits dimensions.

settings DisplaySettings, optional

Tensor 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)