formatters.format_str
format_str(value, col_index=0, **kwargs)Format Python strings to LaTeX text.
Pure conversion: wraps string in without additional decoration. Column wrapping (e.g., prefix) is handled by wrap_column().
By default, value is treated as raw LaTeX: it is spliced into unescaped, so the caller is responsible for escaping any LaTeX-reserved characters (_, %, &, #, $, ~, ^, \) themselves. Set config.display.treat_str_as_markdown = True to instead treat value as Markdown source (see format_markdown / markdown_to_latex): a small set of inline Markdown spans (bold, italic, code, footnotes) are converted to LaTeX commands, and everything else is escaped automatically.
in the LaTeX preamble.
Parameters
value : str String value to format col_index : int, optional Column index (kept for API consistency, not used) **kwargs Ignored
Returns
str LaTeX string with or varwidth wrapper