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
Chemistry figures in manim #10
Comments
Hello,
It is possible to install a LaTeX package and use them if you install manim from its source at https://github.com/3b1b/manim. After dumping your source to your computer, you can go to `/path/to/manim` and then open the file `manimlib/ctex_template.tex`. After opening the file, you can add `\usepackage{...}` to import the packages.
Also, do not forget to re-install this modified version
…________________________________________
From: Luis-Henrique655 <notifications@github.com>
Sent: Wednesday, September 11, 2019 9:17
To: malhotra5/Manim-Tutorial
Cc: Subscribed
Subject: [malhotra5/Manim-Tutorial] Chemistry figures in manim (#10)
I was trying to make molecules ,with manim, arraying polygons, lines and letters and it turn out to be a huge pain. Does someone know if it's possible to install a LaTex package (Chemfig) and use LaTex (the same way we use to generate equations) but to generate LaTex figures in manim ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#10?email_source=notifications&email_token=AF5X74IEUKBJ7HYYOONEXFTQJBBLHA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKS26SA>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AF5X74KXPEXZK2A5HL3QQ6TQJBBLHANCNFSM4IVOD2SA>.
|
Well, there is a mistake to be corrected, also add the lines to `tex_template.tex` as well. You can reinstall using the following command:
cd /path/to/manim
python3 setup.py install
At last you need to use TextMobject instead of TexMobject since the latter one is only for math formula rendering. Inside the TexMobject you only need to specify "\chemfig{...}"
Travor Liu
travor_lzh@outlook.com
… On Sep 11, 2019, at 17:18, Luis-Henrique655 ***@***.***> wrote:
Hi, thank you very much for answering. I downloaded the package and added
in ctex_template. Could you help me a little more? How to re-install this
modified version ? And how to use the package inside the python code? Do I
have to specify the package inside the TexMobject command ?
On Wed, Sep 11, 2019, 10:32 AM Travor Liu ***@***.***> wrote:
> Hello,
> It is possible to install a LaTeX package and use them if you install
> manim from its source at https://github.com/3b1b/manim. After dumping
> your source to your computer, you can go to `/path/to/manim` and then open
> the file `manimlib/ctex_template.tex`. After opening the file, you can add
> `\usepackage{...}` to import the packages.
>
> ________________________________________
> From: Luis-Henrique655 ***@***.***>
> Sent: Wednesday, September 11, 2019 9:17
> To: malhotra5/Manim-Tutorial
> Cc: Subscribed
> Subject: [malhotra5/Manim-Tutorial] Chemistry figures in manim (#10)
>
> I was trying to make molecules ,with manim, arraying polygons, lines and
> letters and it turn out to be a huge pain. Does someone know if it's
> possible to install a LaTex package (Chemfig) and use LaTex (the same way
> we use to generate equations) but to generate LaTex figures in manim ?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub<
> #10?email_source=notifications&email_token=AF5X74IEUKBJ7HYYOONEXFTQJBBLHA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKS26SA>,
> or mute the thread<
> https://github.com/notifications/unsubscribe-auth/AF5X74KXPEXZK2A5HL3QQ6TQJBBLHANCNFSM4IVOD2SA
> >.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#10?email_source=notifications&email_token=ANE4YT5RU4MMPPUXLSUMROTQJDXPPA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OPZFQ#issuecomment-530381974>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ANE4YT5WYG7WD6IT5IWM4OTQJDXPPANCNFSM4IVOD2SA>
> .
>
On Wed, Sep 11, 2019, 10:32 AM Travor Liu ***@***.***> wrote:
> Hello,
> It is possible to install a LaTeX package and use them if you install
> manim from its source at https://github.com/3b1b/manim. After dumping
> your source to your computer, you can go to `/path/to/manim` and then open
> the file `manimlib/ctex_template.tex`. After opening the file, you can add
> `\usepackage{...}` to import the packages.
>
> ________________________________________
> From: Luis-Henrique655 ***@***.***>
> Sent: Wednesday, September 11, 2019 9:17
> To: malhotra5/Manim-Tutorial
> Cc: Subscribed
> Subject: [malhotra5/Manim-Tutorial] Chemistry figures in manim (#10)
>
> I was trying to make molecules ,with manim, arraying polygons, lines and
> letters and it turn out to be a huge pain. Does someone know if it's
> possible to install a LaTex package (Chemfig) and use LaTex (the same way
> we use to generate equations) but to generate LaTex figures in manim ?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub<
> #10?email_source=notifications&email_token=AF5X74IEUKBJ7HYYOONEXFTQJBBLHA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKS26SA>,
> or mute the thread<
> https://github.com/notifications/unsubscribe-auth/AF5X74KXPEXZK2A5HL3QQ6TQJBBLHANCNFSM4IVOD2SA
> >.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#10?email_source=notifications&email_token=ANE4YT5RU4MMPPUXLSUMROTQJDXPPA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OPZFQ#issuecomment-530381974>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ANE4YT5WYG7WD6IT5IWM4OTQJDXPPANCNFSM4IVOD2SA>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Thanks for your help, I really appreciate it. As for the bonding problem, I
don't really know what to do about this so I'll try to look for others
similars packages and see if it works.
…On Wed, Sep 11, 2019, 6:27 PM Travor Liu ***@***.***> wrote:
Well, there is a mistake to be corrected, also add the lines to
`tex_template.tex` as well. You can reinstall using the following command:
cd /path/to/manim
python3 setup.py install
At last you need to use TextMobject instead of TexMobject since the latter
one is only for math formula rendering. Inside the TexMobject you only need
to specify "\chemfig{...}"
Travor Liu
***@***.***
> On Sep 11, 2019, at 17:18, Luis-Henrique655 ***@***.***>
wrote:
>
> Hi, thank you very much for answering. I downloaded the package and
added
> in ctex_template. Could you help me a little more? How to re-install
this
> modified version ? And how to use the package inside the python code? Do
I
> have to specify the package inside the TexMobject command ?
>
> On Wed, Sep 11, 2019, 10:32 AM Travor Liu ***@***.***>
wrote:
>
> > Hello,
> > It is possible to install a LaTeX package and use them if you install
> > manim from its source at https://github.com/3b1b/manim. After dumping
> > your source to your computer, you can go to `/path/to/manim` and then
open
> > the file `manimlib/ctex_template.tex`. After opening the file, you can
add
> > `\usepackage{...}` to import the packages.
> >
> > ________________________________________
> > From: Luis-Henrique655 ***@***.***>
> > Sent: Wednesday, September 11, 2019 9:17
> > To: malhotra5/Manim-Tutorial
> > Cc: Subscribed
> > Subject: [malhotra5/Manim-Tutorial] Chemistry figures in manim (#10)
> >
> > I was trying to make molecules ,with manim, arraying polygons, lines
and
> > letters and it turn out to be a huge pain. Does someone know if it's
> > possible to install a LaTex package (Chemfig) and use LaTex (the same
way
> > we use to generate equations) but to generate LaTex figures in manim ?
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub<
> >
#10?email_source=notifications&email_token=AF5X74IEUKBJ7HYYOONEXFTQJBBLHA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKS26SA>,
> > or mute the thread<
> >
https://github.com/notifications/unsubscribe-auth/AF5X74KXPEXZK2A5HL3QQ6TQJBBLHANCNFSM4IVOD2SA
> > >.
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <
#10?email_source=notifications&email_token=ANE4YT5RU4MMPPUXLSUMROTQJDXPPA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OPZFQ#issuecomment-530381974>,
> > or mute the thread
> > <
https://github.com/notifications/unsubscribe-auth/ANE4YT5WYG7WD6IT5IWM4OTQJDXPPANCNFSM4IVOD2SA>
> > .
> >
>
> On Wed, Sep 11, 2019, 10:32 AM Travor Liu ***@***.***>
wrote:
>
> > Hello,
> > It is possible to install a LaTeX package and use them if you install
> > manim from its source at https://github.com/3b1b/manim. After dumping
> > your source to your computer, you can go to `/path/to/manim` and then
open
> > the file `manimlib/ctex_template.tex`. After opening the file, you can
add
> > `\usepackage{...}` to import the packages.
> >
> > ________________________________________
> > From: Luis-Henrique655 ***@***.***>
> > Sent: Wednesday, September 11, 2019 9:17
> > To: malhotra5/Manim-Tutorial
> > Cc: Subscribed
> > Subject: [malhotra5/Manim-Tutorial] Chemistry figures in manim (#10)
> >
> > I was trying to make molecules ,with manim, arraying polygons, lines
and
> > letters and it turn out to be a huge pain. Does someone know if it's
> > possible to install a LaTex package (Chemfig) and use LaTex (the same
way
> > we use to generate equations) but to generate LaTex figures in manim ?
> >
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub<
> >
#10?email_source=notifications&email_token=AF5X74IEUKBJ7HYYOONEXFTQJBBLHA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HKS26SA>,
> > or mute the thread<
> >
https://github.com/notifications/unsubscribe-auth/AF5X74KXPEXZK2A5HL3QQ6TQJBBLHANCNFSM4IVOD2SA
> > >.
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <
#10?email_source=notifications&email_token=ANE4YT5RU4MMPPUXLSUMROTQJDXPPA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6OPZFQ#issuecomment-530381974>,
> > or mute the thread
> > <
https://github.com/notifications/unsubscribe-auth/ANE4YT5WYG7WD6IT5IWM4OTQJDXPPANCNFSM4IVOD2SA>
> > .
> >
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#10?email_source=notifications&email_token=ANE4YT7WE4BT6GYRJ2M3BVLQJFPCJA5CNFSM4IVOD2SKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6P6NCA#issuecomment-530572936>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANE4YT43J7HQTCXNS7QW54TQJFPCJANCNFSM4IVOD2SA>
.
|
That is because the TextMobject class has a thickness of zero, and those symbols have no thickness, if you use the Write animation you can see they are drawn but disappear, to solve that you can do two things. class Chem(Scene):
def construct(self):
f1 = TextMobject(r"\chemfig{O=H}")
elements = self.show_index(f1[0])
self.add(elements)
f1[0][2:4].set_stroke(None,1,1)
self.play(Write(f1))
self.wait()
def show_index(self,mob,width=0.07):
n = VGroup()
for element,index in zip(mob,range(len(mob))):
i = Text(f"{index}",color=RED).set_width(width)
i.next_to(element,UP,buff=0)
n.add(i)
return n Or, you can look for another chemical package whose symbols are shown by default, you can try this: |
I was trying to make molecules ,with manim, arraying polygons, lines and letters and it turn out to be a huge pain. Does someone know if it's possible to install a LaTex package (Chemfig) and use LaTex (the same way we use to generate equations) but to generate LaTex figures in manim ?
The text was updated successfully, but these errors were encountered: