from keecas import format_value, symbols
# Define symbol with subscript
sigma_Rd = symbols(r"\sigma_{Rd}")
# Format symbol (column 0 - LHS)
format_value(sigma_Rd, col_index=0) # Returns: '\sigma_{Rd}''\\sigma_{Rd}'
Cell and row formatters for LaTeX equation rendering.
This module provides a singledispatch-based formatter system for formatting cell values in mathematical equations. Formatters are dispatched based on value type, providing a clean and extensible interface.
'\\sigma_{Rd}'
'3.14159'
Custom type registration:
| Name | Description |
|---|---|
validate_latex_kwargs |
Validate and filter kwargs for sympy.latex() function. |
format_value |
Format a value to LaTeX string using type-based dispatch. |
format_str |
Format Python strings to LaTeX text. |
format_int |
Format Python integers to LaTeX. |
format_float |
Format Python floats to LaTeX. |
format_markdown |
Format IPython Markdown objects to LaTeX text. |
format_latex |
Format IPython Latex objects to LaTeX text. |
format_pint |
Format Pint quantities by converting to SymPy first. |
format_mul |
Format Mul expressions with numeric/unit separation. |
format_sympy |
Format SymPy expressions to LaTeX. |