TexTemplateFromFile#

Qualified name: manim.utils.tex.TexTemplateFromFile

class TexTemplateFromFile(*, tex_filename='tex_template.tex', **kwargs)[source]#

Bases: TexTemplate

A TexTemplate object created from a template file (default: tex_template.tex)

Parameters:
  • tex_filename (str | os.PathLike) – Path to a valid TeX template file

  • kwargs – Arguments for TexTemplate.

template_file#

Path to a valid TeX template file

Type:

str

body#

Content of the TeX template file

Type:

str

tex_compiler#

The TeX compiler to be used, e.g. latex, pdflatex or lualatex

Type:

str

output_format#

The output format resulting from compilation, e.g. .dvi or .pdf

Type:

str

Methods

add_to_document

Adds txt to the TeX template just after begin{document}, e.g.

add_to_preamble

Adds stuff to the TeX template's preamble (e.g.

file_not_mutable

Attributes

default_documentclass

default_output_format

default_placeholder_text

default_post_doc_commands

default_preamble

default_tex_compiler

_rebuild()[source]#

Rebuilds the entire TeX template text from \documentclass to \end{document} according to all settings and choices.

add_to_document(txt)[source]#

Adds txt to the TeX template just after begin{document}, e.g. \boldmath

Parameters:

txt – String containing the text to be added.

add_to_preamble(txt, prepend=False)[source]#

Adds stuff to the TeX template’s preamble (e.g. definitions, packages). Text can be inserted at the beginning or at the end of the preamble.

Parameters:
  • txt – String containing the text to be added, e.g. \usepackage{hyperref}

  • prepend – Whether the text should be added at the beginning of the preamble, i.e. right after \documentclass. Default is to add it at the end of the preamble, i.e. right before \begin{document}