bundle.latex.elements ===================== .. py:module:: bundle.latex.elements Classes ------- .. autoapisummary:: bundle.latex.elements.Column bundle.latex.elements.Table bundle.latex.elements.Figure bundle.latex.elements.Section Functions --------- .. autoapisummary:: bundle.latex.elements.escape Module Contents --------------- .. py:function:: escape(text: str) -> str Escape special LaTeX characters in a string. .. py:class:: Column(header: str, width: str | None = None, align: str = 'l') Defines a table column with alignment and width. .. py:attribute:: header .. py:attribute:: width :value: None .. py:attribute:: align :value: 'l' .. py:method:: spec() -> str .. py:class:: Table(columns: list[Column], row_color_alt: str | None = None) Build a LaTeX longtable from column definitions and row data. .. py:attribute:: columns .. py:attribute:: row_color_alt :value: None .. py:method:: add_row(values: list[str]) .. py:method:: render() -> str .. py:class:: Figure(image_path: pathlib.Path | str, width: str = '0.85\\linewidth', caption: str | None = None) Render a LaTeX figure with includegraphics. .. py:attribute:: image_path .. py:attribute:: width :value: '0.85\\linewidth' .. py:attribute:: caption :value: None .. py:method:: render() -> str .. py:class:: Section(title: str, level: int = 1) Render a LaTeX section with optional content blocks. .. py:attribute:: title .. py:attribute:: level :value: 1 .. py:method:: add_text(text: str) .. py:method:: add_figure(figure: Figure) .. py:method:: add_table(table: Table) .. py:method:: add_raw(latex_str: str) .. py:method:: render() -> str