TexTemplateFromFile#
Qualified name: manim.utils.tex.TexTemplateFromFile
- class TexTemplateFromFile(**kwargs)[source]#
Bases:
manim.utils.tex.TexTemplate
A TexTemplate object created from a template file (default: tex_template.tex)
- Parameters
tex_compiler (Optional[
str
], optional) – The TeX compiler to be used, e.g.latex
,pdflatex
orlualatex
output_format (Optional[
str
], optional) – The output format resulting from compilation, e.g..dvi
or.pdf
documentclass (Optional[
str
], optional) – The command defining the documentclass, e.g.\documentclass[preview]{standalone}
preamble (Optional[
str
], optional) – The document’s preamble, i.e. the part between\documentclass
and\begin{document}
placeholder_text (Optional[
str
], optional) – Text in the document that will be replaced by the expression to be renderedpost_doc_commands (Optional[
str
], optional) – Text (definitions, commands) to be inserted at right after\begin{document}
, e.g.\boldmath
kwargs (
str
) – The kwargs specified can only be strings.tex_filename (Optional[
str
], optional) – Path to a valid TeX template file
- 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
orlualatex
- Type
str
- output_format#
The output format resulting from compilation, e.g.
.dvi
or.pdf
- Type
str
Methods
Adds txt to the TeX template just after begin{document}, e.g.
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
- add_to_document(txt)[source]#
Adds txt to the TeX template just after begin{document}, e.g.
\boldmath
- Parameters
txt (
str
) – 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
) – String containing the text to be added, e.g.\usepackage{hyperref}
prepend (Optional[
bool
], optional) – 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}