SingleStringMathTex

限定名称: 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, color=None, **kwargs)[source]

基类: SVGMobject

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

测试

检查创建SingleStringMathTex对象是否有效

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

方法

get_tex_string

init_colors

初始化颜色。

属性

animate (动画)

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

animation_overrides (动画覆盖)

颜色

depth (深度)

mobject 的深度。

fill_color (填充颜色)

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

font_size

tex mobject 的字体大小。

哈希种子

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

height (高度)

mobject 的高度。

n_points_per_curve (每条曲线的点数)

sheen_factor (光泽因子)

stroke_color (描边颜色)

width (宽度)

mobject 的宽度。

参数:
  • tex_string (字符串)

  • stroke_width (浮点数)

  • should_center (布尔值)

  • height (浮点数 | )

  • organize_left_to_right (布尔值)

  • tex_environment (字符串)

  • tex_template (TexTemplate | )

  • font_size (浮点数)

  • color (ParsableManimColor | )

_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, color=None, **kwargs)

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

参数:
  • tex_string (字符串)

  • stroke_width (浮点数)

  • should_center (布尔值)

  • height (浮点数 | )

  • organize_left_to_right (布尔值)

  • tex_environment (字符串)

  • tex_template (TexTemplate | )

  • font_size (浮点数)

  • color (ParsableManimColor | )

_remove_stray_braces(tex)[source]

使MathTex能够应对不匹配的大括号。

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

属性 font_size

tex mobject 的字体大小。

init_colors(propagate_colors=True)[source]

初始化颜色。

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