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.

How to add a new line when using TextMobject like arrays

See original GitHub issue

When I use:

t = TextMobject('aaaaa', '''a
        
 a''', 'aaaaa')

批注 2020-03-27 173840

but when I use: t = TextMobject('aaaaaaaaa', '\n\n', 'aaaaaaa') or:

t = TextMobject('aaaaa', '''

         ''', 'aaaaa')

批注 2020-03-27 173932

It’s not what I want. Are there other ways to add a new line when using TextMobject like arrays?

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
TonyCranecommented, May 10, 2020

I think this is much better:

text = VGroup(
    TextMobject(“First\_line”),
    TextMobject(“Second\_line”),
    TextMobject(“Third\_line”)
).arrange(DOWN, aligned_edge=LEFT)

If you want to use “\n”, Text() class supports it. Text(“a\nb\nc”, font=“your font”)

0reactions
nosnakeobcommented, May 12, 2020

I think this is much better:

text = VGroup(
    TextMobject(“First\_line”),
    TextMobject(“Second\_line”),
    TextMobject(“Third\_line”)
).arrange(DOWN, aligned_edge=LEFT)

If you want to use “\n”, Text() class supports it. Text(“a\nb\nc”, font=“your font”)

That’s useful, Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to append newline to text value in javascript array?
To have it rendered, you need to use an element that doesn't ignore whitespace (like <pre> ), or opt in to <pre> -style...
Read more >
Animation — Manim documentation - Read the Docs
Writes the text object passed as argument. Should be used with classes like TexMobject or TextMobject. class AnimationWrite(Scene): def construct(self): ...
Read more >
A conversation about teaching and learning physics | Page 3
To line up parts of the equations on screen we use next_to() and align_to() . For this example we've broken the equation into...
Read more >
Array of Text not working, I got stuck in a tutorial from The Lazy ...
The change is as follows: TextMobject -> Tex. TexMobject -> MathTex. Text uses pango to put the text in the animation circumventing creation ......
Read more >
How can I add a new line in string in array
I match the answers with the text in the array and trying to insert this text in to the word document template. Everything...
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