单字符串数学公式

限定名称: manim.mobject.text.tex\_mobject.SingleStringMathTex

class SingleStringMathTex(tex_string, stroke_width=0, should_center=True, height=None, organize_left_to_right=False, tex_environment='align*', tex_template=None, font_size=48, **kwargs)[来源]

基础类: SVGMobject

用于使用LaTeX渲染文本的基本构建块。

测试

检查创建 SingleStringMathTex 对象是否有效:

>>> SingleStringMathTex('Test') 
SingleStringMathTex('Test')

方法

get_tex_string

init_colors

初始化颜色。

属性

animate

用于动画化self的任何方法的应用。

animation_overrides

color

depth

mobject的深度。

fill_color

如果有多种颜色(用于渐变),则返回第一个颜色

font_size

tex mobject 的字体大小。

hash_seed

表示生成的mobject点结果的唯一哈希值。

height

mobject的高度。

n_points_per_curve

sheen_factor

stroke_color

width

mobject的宽度。

Parameters:
  • tex_string (str)

  • stroke_width (float)

  • should_center (bool)

  • height (float | None)

  • organize_left_to_right (bool)

  • tex_environment (str)

  • tex_template (TexTemplate | None)

  • font_size (float)

_original__init__(tex_string, stroke_width=0, should_center=True, height=None, organize_left_to_right=False, tex_environment='align*', tex_template=None, font_size=48, **kwargs)

初始化自身。有关准确的签名,请参阅 help(type(self))。

Parameters:
  • tex_string (str)

  • stroke_width (float)

  • should_center (bool)

  • height (float | None)

  • organize_left_to_right (bool)

  • tex_environment (str)

  • tex_template (TexTemplate | None)

  • font_size (float)

_remove_stray_braces(tex)[来源]

使MathTex对不匹配的大括号具有弹性。

当TeX代码中的大括号分布在多个参数中时,这一点很重要,例如,MathTex(r"e^{i", r"\tau} = 1")

property font_size

tex mobject 的字体大小。

init_colors(propagate_colors=True)[source]

初始化颜色。

在创建时调用。这是一个可以由子类实现的空方法。