Skip to content

LaTex

LaTex Parameters#

Paremeters - as mentioned in Manim Community Documentation - are:

  • Constructor : - Tex() - MathTex()

  • Parameters :

  • run_time : The duration of the animation

    • float (ex: 3)
    • Optional
    • Default: DEFAULT_ANIMATION_RUN_TIME
  • color :

    • color (ex: BLUE)
    • Optional
    • Default : (WHITE)
  • font_size :

    • float (ex: 30)
    • Optional
  • line_spacing :

    • float (ex: 3.0)
    • Optional
  • height :

    • integer (ex: 4)
    • Optional
  • width :

    • integer (ex: 2)
    • Optional

Writing LaTex#

from manimlib import *
import numpy as np

class Latex1(Scene):
    def construct(self):

        equations = Tex(r"\frac{dy}{dx} = m_t = \tan \theta = \grave{y} = \grave{f}(x)")
        self.play(Write(equations), run_time=6)
        self.wait(2)
from manim import *
import numpy as np

class Latex1(Scene):
    def construct(self):

        equations = MathTex(r"\frac{dy}{dx} = m_t = \tan \theta = \grave{y} = \grave{f}(x)")
        self.play(Write(equations), run_time=4)
        self.wait(2)

Changing Color & Font Size#

from manimlib import *
import numpy as np

class LatexMath(Scene):
    def construct(self):

        equations = Tex(r"\frac{dy}{dx} = m_t = \tan \theta = \grave{y} = \grave{f}(x)"
                        , color=ORANGE, font_size=60)
        self.play(Write(equations), run_time=4)
        self.wait(2)
from manim import *
import numpy as np

class LatexMath(Scene):
    def construct(self):

        equations = MathTex(r"\frac{dy}{dx} = m_t = \tan \theta = \grave{y} = \grave{f}(x)"
                            , color=ORANGE, font_size=60)
        self.play(Write(equations), run_time=4)
        self.wait(2)
Back to top