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.

Hello I was trying to do an animation using square roots, but when i write the code like this: TexMobject(r"\sqrt{",r"\left(",r"5",r"-",r"{9",r"\over",r"2}",r"\right)",r"^2}",r"=",r"\sqrt{",r"\left(",r"4",r"-",r"{9",r"\over",r"2}",r"\right)",r"^2\tiny.}") And then Writing (or adding) on the scene, it shows the whole equation, except the last character (the “2” exponent).

I watch a video that use a “\tiny .” to solve this, but it doesn’t work to me.

I’m using Windows 10, the last version of Manim.

Problema

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
NeoPlatocommented, Sep 25, 2020

Update on my solution.

I haven’t really found anything yet, admittedly due to minimal reflection on the issue but I have stumbled upon something.

That method somehow has to stay because it makes the tex_to_color_map work so if you wanted to use that that may be a problem.

Again, if I come up with anything is a fingers crossed protocol. Hopefully someone else beats me to the chase.

0reactions
Jiricek72commented, Feb 26, 2021

Hello,

it seems, that manim is expecting at least one character after the { of \sqrt{. So I tried to add a space in Tex. This can be one of these codes:

\, \: ~

The space is barely visible in the output but it worked for me.

from manim import *
config.background_color = WHITE


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

    u_formel_1b = MathTex(
            "\\hat{u} = \\sqrt{\,",
            "\\hat{u}_{R}^{2}",
            " + ",
            "\\hat{u}_{C}^{2}}}",
            color= BLACK
        )
    u_formel_1b[1].set_color(GREEN)

    self.play(Write(u_formel_1b))
    self.wait(5)
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve Square Root Problems (with Pictures) - wikiHow
Simple square root problems can often be solved as easily as basic multiplication and division problems. More complex square root problems, on the...
Read more >
Sqrt(x) - LeetCode
Given a non-negative integer x , return the square root of x rounded down to the nearest integer. The returned integer should be...
Read more >
Square root of an integer - GeeksforGeeks
Square root an integer using Binary search: · Base cases for the given problem are when the given number is 0 or 1,...
Read more >
sqrt
The sqrt() function computes the square root of x,. An application wishing to check for error situations should set errno to 0 before...
Read more >
sqrt problem in c++ - Stack Overflow
There are three overloads of sqrt which take different parameters: float sqrt(float) , double sqrt(double) and long double sqrt(long double) ...
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