Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active March 19, 2023 13:35
Show Gist options
  • Save uwezi/2855c6e0edfc81df4e3fce8aa0bb5c93 to your computer and use it in GitHub Desktop.
Save uwezi/2855c6e0edfc81df4e3fce8aa0bb5c93 to your computer and use it in GitHub Desktop.
[Pointing to individual characters in a Tex-string] How to draw an arrow pointing to individual characters in a LaTeX object. #manim #latex #animate
# https://discord.com/channels/581738731934056449/1026231302069964831/1026240005401751582
from manim import *
class moving(Scene):
def construct(self):
text = Tex(r"And ",r"still ",r"it ", r"moves!")
self.play(Write(text))
arr = Arrow(start=ORIGIN, end=1*UP, buff=0).next_to(text[0],DOWN,buff=0)
self.play(Create(arr))
for i in range(1,len(text)):
self.play(arr.animate.next_to(text[i],DOWN,buff=0.05))
self.wait(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment