Links:

Positions:

  • .to_edge(UP/DOWN/LEFT/RIGHT), to change distance, use e.g: .to_edge(LEFT, buffer = 1.0)
  • .to_corner(UR/UL/DR/DL)
  • .move_to(vector) or .move_to(ref_object.get_center() + vector) with vector = np.array([x,y,0])
  • .next_to(ref_object, direction, [buff])
  • .rotate(angle, [about_point=point]), angle in rads, e.g. PI/4 in degrees: 45*DEGREES
  • .flip(axis)

Text:

  • Normal: TextMobject("\\textrm{Text}")
  • Bold: \\textbf
  • Italic: \\textit
  • Typewriter: \\texttt
  • Slanted: \\textsl
  • Small Caps: \\textsc
  • Colors: .set_color(RED/BLUE/YELLOW), see manimlib/constants.py for pre-defined colors
  • List: text = TextMObject("A","B","C"), address with text[0] etc to have different fonts, colors
  • Put more lines in group with VGroup(line, line2)

Latex:

  • Use TexMobject(r" latex formula") or TexMobject(" latex formula with \\"), enclose text with \text{}, lists are possible: line = TexMobject(r"\text{The force} F =", r"m \cdot a"}
  • Color with line.set_color_by_tex("part of substring", COLOR) or with line.set_color_by_tex_to_color_map({"substring1": COLOR1, "substring2": COLOR2})
  • Use TextMobject(" text $\\displaystyle Latex part with \\$")
  • \frac -> \over
  • multiline formulas: use """ formula line 1 \\ formula line 2 """
  • Spacing of multilines with: .arrange_submobjects(DOWN, buff=MED_LARGE_BUFF)
  • Braces: brace = Brace(eq_group, position) then eq_text = brace.get_text("text")

-- NicoloDeGroot - 2019-06-11

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2019-06-13 - NicoloDeGroot
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback