-
-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(2d): use SVG component in Latex and support tweening #800
base: main
Are you sure you want to change the base?
Conversation
Does this branch support changing the color of some parts of the latex? Let's say highlight some parts of the equation for example. |
I get the following errors when running your example:
|
@benniel Can you rerun example on latest commit? Before rerun reinstall all npm packages ( |
You can use I will create new Pull Request for animating LaTex color. |
@aarthificial Can you review this PR? |
Would it be possible to do a write-in animation with this PR like in manim? (i.e. sequentially drawing the path for each symbol?) |
I would love to see that too !! |
Any update on this? I'd really like to see it in the library. |
+1 I would also love to see this in Motion Canvas :) |
This PR add tweening support for Latex component. This PR will fix #482
How it Work?
Latex component now inherit SVG component. Latex tweening algorithm will follow SVG tweening algorithm.
Changed Behavior
Old behavior: Latex component's size is depend on custom width or custom height
New behavior: Latex component's size is depend on font size. With this, With this, we can synchronize Txt size and Latex size more easily.
Latex Tweening
Latex can be splitted into subtex. To make subtex we just enclose part of tex with
{{}}
. Why?. The reason is to make tweening more flexible. User can choose where transformed, inserted or deleted subtex.Latex
svg
propery can be string or array of string. When it string, it will be parsed to list of substring.How to Use?
To use Latex tweening we can use tween
tex
property as normal.Examples and Result
This is example usage of Latex tweening:
Here is the result:
out.mp4