pygacity.generate.document module

Document build functions for pygacity

class pygacity.generate.document.Document(document_specs: dict)[source]

Bases: object

Represents a LaTeX document composed of multiple blocks.

specs

document specifications

Type:

dict

blocks

list of blocks in the document

Type:

list of LatexCompoundBlock

preamble

list of LaTeX preamble lines

Type:

list of str

substitutions

dictionary of substitutions to apply in the document

Type:

dict

has_pycode

indicates if the document contains embedded Python code

Type:

bool

embedded_graphics

list of embedded graphics file paths

Type:

list of str

make_substitutions(outer_substitutions: dict = {})[source]

Applies substitutions to all blocks in the document.

Parameters:

outer_substitutions (dict, optional) – additional substitutions to apply (default is empty dict)

resources_root: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/pygacity/envs/latest/lib/python3.12/site-packages/pygacity/resources')

Root directory for resource files.

templates_dir: Path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/pygacity/envs/latest/lib/python3.12/site-packages/pygacity/resources/templates')

Directory for template files.

write_source(local_output_name: str = 'local_document')[source]

Writes the LaTeX source of the document to a .tex file.

Parameters:

local_output_name (str, optional) – base name for the output .tex file (default is ‘local_document’)