mirror of
https://github.com/3b1b/manim.git
synced 2025-08-03 04:04:36 +08:00
Clean up tex_file_writing
This commit is contained in:
@ -7,7 +7,7 @@ import re
|
||||
from manimlib.constants import BLACK, WHITE
|
||||
from manimlib.mobject.svg.svg_mobject import SVGMobject
|
||||
from manimlib.mobject.types.vectorized_mobject import VGroup
|
||||
from manimlib.utils.tex_file_writing import tex_to_svg
|
||||
from manimlib.utils.tex_file_writing import latex_to_svg
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@ -79,7 +79,7 @@ class SingleStringTex(SVGMobject):
|
||||
def get_svg_string_by_content(self, content: str) -> str:
|
||||
return get_cached_value(
|
||||
key=hash_string(str((content, self.template, self.additional_preamble))),
|
||||
value_func=lambda: tex_to_svg(content, self.template, self.additional_preamble),
|
||||
value_func=lambda: latex_to_svg(content, self.template, self.additional_preamble),
|
||||
message=f"Writing {self.tex_string}..."
|
||||
)
|
||||
|
||||
|
@ -9,7 +9,7 @@ from manimlib.mobject.types.vectorized_mobject import VMobject
|
||||
from manimlib.utils.cache import get_cached_value
|
||||
from manimlib.utils.color import color_to_hex
|
||||
from manimlib.utils.color import hex_to_int
|
||||
from manimlib.utils.tex_file_writing import tex_to_svg
|
||||
from manimlib.utils.tex_file_writing import latex_to_svg
|
||||
from manimlib.utils.tex import num_tex_symbols
|
||||
from manimlib.utils.simple_functions import hash_string
|
||||
from manimlib.logger import log
|
||||
@ -88,7 +88,7 @@ class Tex(StringMobject):
|
||||
def get_svg_string_by_content(self, content: str) -> str:
|
||||
return get_cached_value(
|
||||
key=hash_string(str((content, self.template, self.additional_preamble))),
|
||||
value_func=lambda: tex_to_svg(content, self.template, self.additional_preamble),
|
||||
value_func=lambda: latex_to_svg(content, self.template, self.additional_preamble),
|
||||
message=f"Writing {self.tex_string}..."
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user