Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

2022-12 updates necessary! #28

Description

@uwezi

I'm not good in handling forks on github, but here are the changes necessary to make chanim compatible with both the latest version of LaTeX/chemfig/Tikz and Manim v0.17:

in templates.py change the empty strings against "{}"
`
class ChemTemplate(TexTemplate):
def init(self,**kwargs):
super().init(**kwargs)
self.add_to_preamble("\usepackage{chemfig}")

def set_chemfig(
    self,
    atom_sep: str = "2em", ## all of these are the defaults in chemfig
    chemfig_style:str="{}",
    atom_style:str="{}",
    angle_increment:int=45,
    bond_offset:str="2pt",
    double_bond_sep:str="2pt",
    node_style:str="{}",
    bond_style:str="{}",
):
    set_chemfig = "\\setchemfig{atom sep=%s,chemfig style=%s, atom style=%s,angle increment=%d,bond offset=%s,double bond sep=%s, node style=%s, bond style=%s}" % (atom_sep,chemfig_style,atom_style,angle_increment,bond_offset,double_bond_sep,node_style,bond_style)
    self.add_to_preamble(set_chemfig)

`

in chem_objects.py recreate the class TexSymbol
from manim.mobject.text.tex_mobject import * from manim.mobject.svg.svg_mobject import VMobjectFromSVGPath class TexSymbol(VMobjectFromSVGPath): """Purely a renaming of SVGPathMobject.""" pass
At least I am able to render the first example again with these settings.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions