3b1b / 3b1b/manim

Persistent trouble getting manim to use tikz

Ouverte
#1,208 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
LaTeX
Langage dominant
Python
Étoiles
93.8k
Forks
7.7k
Métriques de merge des PR
Métriques de PR en attente

Description

2

I've watched videos on how to get manim to use tikz and followed several threads to fix issues, but nothing seems to help.

I've modified the tex_template.tex to include the requisite packages and changed the document class to "preview,dvisvgm".

I also modified tex_file_writing.py to include

`"--libgs='/usr/local/Cellar/ghostscript/9.26_1/lib/libgs.dylib'"
`
in the dvi_to_svg section.

Despite all this I keep getting: Exception: Latex error converting to dvi. when trying to run

```
from manimlib.imports import *

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

TreeDiagram = TexMobject(r"""
\begin{tikzpicture}[level distance=5em, level 1/.style={sibling distance=5cm},
level 2/.style={sibling distance=2.5cm}, level 3/.style={sibling distance=1cm},
every node/.style = {shape=rectangle, rounded corners,
draw, align=center,
top color=white, bottom color=blue!20}]]
\node {Start}
child { node {$s_1$}
child { node {$p_1$}
child { node{$f_1$}}
child {node{$f_2$}}}
child { node {$p_2$}
child { node{$f_1$}}
child {node{$f_2$}}}}
child { node {$s_2$}
child { node {$p_1$}
child {node {$f_1$}}
child {node {$f_2$}}}
child { node {$p_2$}
child {node {$f_1$}}
child {node {$f_2$}}}}
child { node {$s_3$}
child { node {$p_1$}
child {node {$f_1$}}
child {node {$f_2$}}}
child { node {$p_2$}
child {node {$f_1$}}
child {node {$f_2$}}}};

\end{tikzpicture}""")

self.play(Write(TreeDiagram))
```

Any help is much appreciated.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

The issue involves tex_template.tex and tex_file_writing.py. Start by examining the LaTeX template configuration and the dvi_to_svg conversion process, particularly the ghostscript library path. Check the error logs from the LaTeX compilation to diagnose the 'Latex error converting to dvi'. Verify the TikZ package inclusion and document class settings. A successful fix will allow the provided TikZ tree diagram to render without the exception.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
latex, python
Domaine
tooling
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.