File size: 4,983 Bytes
dc00adb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# SingleStringMathTex

Qualified name: `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)

Bases: [`SVGMobject`](manim.mobject.svg.svg_mobject.SVGMobject.md#manim.mobject.svg.svg_mobject.SVGMobject)

Elementary building block for rendering text with LaTeX.

### Tests

Check that creating a [`SingleStringMathTex`](#manim.mobject.text.tex_mobject.SingleStringMathTex) object works:

```default
>>> SingleStringMathTex('Test') 
SingleStringMathTex('Test')
```

### Methods

| `get_tex_string`                                                                 |                         |
|----------------------------------------------------------------------------------|-------------------------|
| [`init_colors`](#manim.mobject.text.tex_mobject.SingleStringMathTex.init_colors) | Initializes the colors. |

### Attributes

| `animate`                                                                    | Used to animate the application of any method of `self`.               |
|------------------------------------------------------------------------------|------------------------------------------------------------------------|
| `animation_overrides`                                                        |                                                                        |
| `color`                                                                      |                                                                        |
| `depth`                                                                      | The depth of the mobject.                                              |
| `fill_color`                                                                 | If there are multiple colors (for gradient) this returns the first one |
| [`font_size`](#manim.mobject.text.tex_mobject.SingleStringMathTex.font_size) | The font size of the tex mobject.                                      |
| `hash_seed`                                                                  | A unique hash representing the result of the generated mobject points. |
| `height`                                                                     | The height of the mobject.                                             |
| `n_points_per_curve`                                                         |                                                                        |
| `sheen_factor`                                                               |                                                                        |
| `stroke_color`                                                               |                                                                        |
| `width`                                                                      | The width of the mobject.                                              |
* **Parameters:**
  * **tex_string** (*str*)
  * **stroke_width** (*float*)
  * **should_center** (*bool*)
  * **height** (*float* *|* *None*)
  * **organize_left_to_right** (*bool*)
  * **tex_environment** (*str* *|* *None*)
  * **tex_template** ([*TexTemplate*](manim.utils.tex.TexTemplate.md#manim.utils.tex.TexTemplate) *|* *None*)
  * **font_size** (*float*)
  * **color** ([*ParsableManimColor*](manim.utils.color.core.md#manim.utils.color.core.ParsableManimColor) *|* *None*)
  * **kwargs** (*Any*)

#### \_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)

Initialize self.  See help(type(self)) for accurate signature.

* **Parameters:**
  * **tex_string** (*str*)
  * **stroke_width** (*float*)
  * **should_center** (*bool*)
  * **height** (*float* *|* *None*)
  * **organize_left_to_right** (*bool*)
  * **tex_environment** (*str* *|* *None*)
  * **tex_template** ([*TexTemplate*](manim.utils.tex.TexTemplate.md#manim.utils.tex.TexTemplate) *|* *None*)
  * **font_size** (*float*)
  * **color** ([*ParsableManimColor*](manim.utils.color.core.md#manim.utils.color.core.ParsableManimColor) *|* *None*)
  * **kwargs** (*Any*)

#### \_remove_stray_braces(tex)

Makes [`MathTex`](manim.mobject.text.tex_mobject.MathTex.md#manim.mobject.text.tex_mobject.MathTex) resilient to unmatched braces.

This is important when the braces in the TeX code are spread over
multiple arguments as in, e.g., `MathTex(r"e^{i", r"\tau} = 1")`.

* **Parameters:**
  **tex** (*str*)
* **Return type:**
  str

#### *property* font_size *: float*

The font size of the tex mobject.

#### init_colors(propagate_colors=True)

Initializes the colors.

Gets called upon creation. This is an empty method that can be implemented by
subclasses.

* **Parameters:**
  **propagate_colors** (*bool*)
* **Return type:**
  *Self*