Skip to content

Commit 6ccdb9f

Browse files
authored
Merge pull request #4 from PhilippImhof/pr-483-docstrings
class docstrings tex.py
2 parents 6720c86 + 79d0d7c commit 6ccdb9f

File tree

1 file changed

+67
-2
lines changed

1 file changed

+67
-2
lines changed

manim/utils/tex.py

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,38 @@
1010

1111

1212
class TexTemplate:
13-
"""TeX templates are used for creating Tex() and MathTex() objects."""
13+
"""TeX templates are used for creating Tex() and MathTex() objects.
14+
15+
Parameters
16+
----------
17+
tex_compiler : Optional[:class:`str`], optional
18+
The TeX compiler to be used, e.g. ``latex``, ``pdflatex`` or ``lualatex``
19+
output_format : Optional[:class:`str`], optional
20+
The output format resulting from compilation, e.g. ``.dvi`` or ``.pdf``
21+
documentclass : Optional[:class:`str`], optional
22+
The command defining the documentclass, e.g. ``\\documentclass[preview]{standalone}``
23+
preamble : Optional[:class:`str`], optional
24+
The document's preample, i.e. the part between ``\\documentclass`` and ``\\begin{document}``
25+
placeholder_text : Optional[:class:`str`], optional
26+
Text in the document that will be replaced by the expression to be rendered
27+
post_doc_commands : Optional[:class:`str`], optional
28+
Text (definitions, commands) to be inserted at right after ``\\begin{document}``, e.g. ``\\boldmath``
29+
30+
Attributes
31+
----------
32+
tex_compiler : :class:`str`
33+
The TeX compiler to be used, e.g. ``latex``, ``pdflatex`` or ``lualatex``
34+
output_format : :class:`str`
35+
The output format resulting from compilation, e.g. ``.dvi`` or ``.pdf``
36+
documentclass : :class:`str`
37+
The command defining the documentclass, e.g. ``\\documentclass[preview]{standalone}``
38+
preamble : :class:`str`
39+
The document's preample, i.e. the part between ``\\documentclass`` and ``\\begin{document}``
40+
placeholder_text : :class:`str`
41+
Text in the document that will be replaced by the expression to be rendered
42+
post_doc_commands : :class:`str`
43+
Text (definitions, commands) to be inserted at right after ``\\begin{document}``, e.g. ``\\boldmath``
44+
"""
1445

1546
default_documentclass = r"\documentclass[preview]{standalone}"
1647
default_preamble = r"""
@@ -160,7 +191,41 @@ def get_texcode_for_expression_in_env(self, expression, environment):
160191

161192

162193
class TexTemplateFromFile(TexTemplate):
163-
"""A TexTemplate object created from a template file (default: tex_template.tex)"""
194+
"""A TexTemplate object created from a template file (default: tex_template.tex)
195+
196+
Parameters
197+
----------
198+
tex_compiler : Optional[:class:`str`], optional
199+
The TeX compiler to be used, e.g. ``latex``, ``pdflatex`` or ``lualatex``
200+
output_format : Optional[:class:`str`], optional
201+
The output format resulting from compilation, e.g. ``.dvi`` or ``.pdf``
202+
documentclass : Optional[:class:`str`], optional
203+
The command defining the documentclass, e.g. ``\\documentclass[preview]{standalone}``
204+
preamble : Optional[:class:`str`], optional
205+
The document's preample, i.e. the part between ``\\documentclass`` and ``\\begin{document}``
206+
placeholder_text : Optional[:class:`str`], optional
207+
Text in the document that will be replaced by the expression to be rendered
208+
post_doc_commands : Optional[:class:`str`], optional
209+
Text (definitions, commands) to be inserted at right after ``\\begin{document}``, e.g. ``\\boldmath``
210+
kwargs : :class:`str`
211+
The kwargs specified can only be strings.
212+
213+
Other Parameters
214+
----------------
215+
tex_filename : Optional[:class:`str`], optional
216+
Path to a valid TeX template file
217+
218+
Attributes
219+
----------
220+
template_file : :class:`str`
221+
Path to a valid TeX template file
222+
body : :class:`str`
223+
Content of the TeX template file
224+
tex_compiler : :class:`str`
225+
The TeX compiler to be used, e.g. ``latex``, ``pdflatex`` or ``lualatex``
226+
output_format : :class:`str`
227+
The output format resulting from compilation, e.g. ``.dvi`` or ``.pdf``
228+
"""
164229

165230
def __init__(self, **kwargs):
166231
self.template_file = kwargs.pop("filename", "tex_template.tex")

0 commit comments

Comments
 (0)