MCPcopy
hub / github.com/ManimCommunity/manim / get_texcode_for_expression

Method get_texcode_for_expression

manim/utils/tex.py:129–142  ·  view source on GitHub ↗

r"""Inserts expression verbatim into TeX template. Parameters ---------- expression The string containing the expression to be typeset, e.g. ``$\sqrt{2}$`` Returns ------- :class:`str` LaTeX code based on current template, con

(self, expression: str)

Source from the content-addressed store, hash-verified

127 return self
128
129 def get_texcode_for_expression(self, expression: str) -> str:
130 r"""Inserts expression verbatim into TeX template.
131
132 Parameters
133 ----------
134 expression
135 The string containing the expression to be typeset, e.g. ``$\sqrt{2}$``
136
137 Returns
138 -------
139 :class:`str`
140 LaTeX code based on current template, containing the given ``expression`` and ready for typesetting
141 """
142 return self.body.replace(self.placeholder_text, expression)
143
144 def get_texcode_for_expression_in_env(
145 self, expression: str, environment: str

Callers 2

generate_tex_fileFunction · 0.80

Calls 1

replaceMethod · 0.45

Tested by 1