bundle.latex ============ .. py:module:: bundle.latex Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/bundle/latex/document/index /autoapi/bundle/latex/elements/index Classes ------- .. autoapisummary:: bundle.latex.Document bundle.latex.Figure bundle.latex.Section bundle.latex.Table Functions --------- .. autoapisummary:: bundle.latex.escape Package Contents ---------------- .. py:class:: Document(title: str, author: str = 'TheBundle', landscape: bool = True, theme: Theme | None = None, margin: str = '0.75in') Build a complete LaTeX document and compile to PDF. .. py:attribute:: PACKAGES :value: ['graphicx', ('xcolor', 'table'), 'geometry', 'booktabs', 'longtable', 'hyperref', ('inputenc',... .. py:attribute:: title .. py:attribute:: author :value: 'TheBundle' .. py:attribute:: landscape :value: True .. py:attribute:: theme .. py:attribute:: margin :value: '0.75in' .. py:method:: add_preamble(latex_str: str) .. py:method:: add_section(section: bundle.latex.elements.Section) .. py:method:: render() -> str .. py:method:: build_pdf() -> bytes Compile the document to PDF bytes. .. py:method:: save_pdf(output_path: pathlib.Path) Compile and save the document to a PDF file. .. 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 .. 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:function:: escape(text: str) -> str Escape special LaTeX characters in a string.