Skip to content

Commit 3b4fca2

Browse files
authored
fix: return value of TexTemplate.add_to... (#3343)
Unlike similar methods on other objects .add_to_preamble and .add_to_document do not return the TexTemplate object itself. This does not allow for stacking these methods. Just added the `return self` for both methods Co-authored-by: Uwe Zimmermann <C:\Users\uwezi\AppData\Roaming\The Bat! Pwd>
1 parent eac99e8 commit 3b4fca2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

manim/utils/tex.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def add_to_preamble(self, txt: str, prepend: bool = False):
139139
else:
140140
self.preamble += "\n" + txt
141141
self._rebuild()
142+
return self
142143

143144
def add_to_document(self, txt: str):
144145
"""Adds txt to the TeX template just after \\begin{document}, e.g. ``\\boldmath``
@@ -150,6 +151,7 @@ def add_to_document(self, txt: str):
150151
"""
151152
self.post_doc_commands += "\n" + txt + "\n"
152153
self._rebuild()
154+
return self
153155

154156
def get_texcode_for_expression(self, expression: str):
155157
"""Inserts expression verbatim into TeX template.

0 commit comments

Comments
 (0)