question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Copying style and position of TexMobject

See original GitHub issue

I saw it somewhere in the manim tutorial by TheoremofBeethoven but I cannot find it anymore.

I have the following TexMobject:

        formula = TexMobject("2x", "=", "8")
        formula.move_to(DOWN*2)
        formula[0].set_color(RED)
        formula[2].set_color(BLUE)

Now the seperate parts are already individually aligned on the screen. Now I want to change formula[0] to for example x, but with the same style and position as it currently is.

How do I do that most efficiently? I could create a new TexMobject, then move it to formula[0] and set the color again to RED, but I think you can copy all those attributes/properties, right?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
stevenschncommented, Apr 18, 2020

I don’t know if I understood your problem correctly; I think you’re looking for

formula[0].match_style(x)

It makes the stroke, the fill, and the background-related properties the same.

This is exactly it! Thank you! I will now close this issue.

0reactions
PgBielcommented, Apr 18, 2020

I don’t know if I understood your problem correctly; I think you’re looking for

formula[0].match_style(x)

It makes the stroke, the fill, and the background-related properties the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to modify a copy of an object : r/manim - Reddit
I created a copy of and object and i would like to know how i can ... delta.next_to(equation,3*DOWN) solution=TexMobject("x_{1,2}","=","{-" ...
Read more >
Aligning Text – manim Series: Part 6 - Talking Physics
We will first write a program to align elements of two equations but in a somewhat clunky fashion; this is not the most...
Read more >
Moving and Copying Text and Objects - InformIT
Select the text or object(s) you want to move or copy. · (Optional) To copy, hold down the Ctrl key. · Position the...
Read more >
What's new - manim documentation
Usage changes of new version manim¶ · Can be called by self.camera. · All methods of Mobject can be used, such as .shift()...
Read more >
Novice Life: Persistent trouble getting manim to run tikz
Why are you using TexMobject instead TextMobject ? ... level 2/.style={sibling distance=2.5cm}, level 3/.style={sibling distance=1cm}] \node ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found