from keecas import wrap_column, symbols
# Define symbol
x = symbols("x")
# LHS - no wrapping
wrap_column(x, col_index=0) # Returns: ('', '')('', '')
Return (prefix, suffix) for column wrapping based on value type.
This is the main entry point for wrapping columns in keecas equations. Dispatches to specialized wrappers based on value type. For unhandled types, returns no wrapping (empty strings).
value : Any Value to wrap (any type) col_index : int, optional Column index - 0 for LHS, 1+ for RHS (default: 0) LHS columns (0) typically get no wrapping RHS columns (1+) get type-specific decoration **kwargs Additional arguments (reserved for future use)
tuple[str, str] (prefix, suffix) tuple for wrapping the formatted value
('', '')
To register custom type wrappers:
Supported types (built-in registrations): - int: ‘=’ prefix for RHS - float: ‘=’ prefix for RHS - str: ‘’ prefix for RHS - sympy.Basic: ‘=’ prefix for RHS - pint.Quantity: ‘=’ prefix for RHS (optional) - IPython.display.Markdown: ‘’ prefix for RHS (optional) - IPython.display.Latex: ‘’ prefix for RHS (optional)
formatters.format_value : Cell formatter for type-based LaTeX conversion