Reputation: 63
I tried compiling the following code:
class I3(Scene):
def construct(self):
z = Tex("e^{i\theta}=\cos(\theta)+i\sin(\theta)")
self.add(z)
self.wait(5)
But I got this error:
ValueError: latex error converting to dvi. See log output above or the log file: media/Tex/d946638dc8ff7097.log
The .log file mentioned is:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.3) (preloaded format=latex 2022.7.16) 17 JUL 2022 18:20
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**./media/Tex/d946638dc8ff7097.tex
(media/Tex/d946638dc8ff7097.tex
LaTeX2e <2022-06-01> patch level 3
L3 programming layer <2022-06-16> (C:\Program Files\MiKTeX\tex/latex/standalone
\standalone.cls
Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan
dalone
(C:\Program Files\MiKTeX\tex/latex/tools\shellesc.sty
Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX
Package shellesc Info: Restricted shell escape enabled on input line 77.
) (C:\Program Files\MiKTeX\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
(C:\Program Files\MiKTeX\tex/generic/iftex\iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)) (C:\Program Files\MiKTeX\tex/latex/xkeyval\xkeyval.sty
Package: xkeyval 2022/06/16 v2.9 package option processing (HA)
(C:\Program Files\MiKTeX\tex/generic/xkeyval\xkeyval.tex (C:\Program Files\MiKT
eX\tex/generic/xkeyval\xkvutils.tex
\XKV@toks=\toks16
\XKV@tempa@toks=\toks17
(C:\Program Files\MiKTeX\tex/generic/xkeyval\keyval.tex))
\XKV@depth=\count185
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
\sa@internal=\count186
\c@sapage=\count187
(C:\Program Files\MiKTeX\tex/latex/standalone\standalone.cfg
File: standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalon
e' class
) (C:\Program Files\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Program Files\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count188
\c@section=\count189
\c@subsection=\count190
\c@subsubsection=\count191
\c@paragraph=\count192
\c@subparagraph=\count193
\c@figure=\count194
\c@table=\count195
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/preview\preview.sty
Package: preview 2017/04/24 13.1 (AUCTeX/preview-latex)
(C:\Program Files\MiKTeX\tex/latex/luatex85\luatex85.sty
Package: luatex85 2016/06/15 v1.4 pdftex aliases for luatex
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/preview\prtightpage.def
\PreviewBorder=\dimen139
)
\pr@snippet=\count196
\pr@box=\box51
\pr@output=\toks18
)) (C:\Program Files\MiKTeX\tex/generic/babel\babel.sty
Package: babel 2022/06/06 3.76 The Babel package
\babel@savecnt=\count197
\U@D=\dimen140
\l@unhyphenated=\language79
(C:\Program Files\MiKTeX\tex/generic/babel\txtbabel.def)
\bbl@readstream=\read2
\bbl@dirlevel=\count198
*************************************
* Local config file bblopts.cfg used
*
(C:\Program Files\MiKTeX\tex/latex/arabi\bblopts.cfg
File: bblopts.cfg 2005/09/08 v0.1 add Arabic and Farsi to "declared" options of
babel
) (C:\Program Files\MiKTeX\tex/latex/babel-english\english.ldf
Language: english 2017/06/06 v3.3r English support from the babel system
Package babel Info: Hyphen rules for 'canadian' set to \l@english
(babel) (\language0). Reported on input line 102.
Package babel Info: Hyphen rules for 'australian' set to \l@ukenglish
(babel) (\language73). Reported on input line 105.
Package babel Info: Hyphen rules for 'newzealand' set to \l@ukenglish
(babel) (\language73). Reported on input line 108.
)) (C:\Program Files\MiKTeX\tex/generic/babel/locale/en\babel-english.tex
Package babel Info: Importing font and identification data for english
(babel) from babel-en.ini. Reported on input line 11.
) (C:\Program Files\MiKTeX\tex/latex/base\inputenc.sty
Package: inputenc 2021/02/14 v1.3d Input encoding file
\inpenc@prehook=\toks19
\inpenc@posthook=\toks20
) (C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
) (C:\Program Files\MiKTeX\tex/latex/lm\lmodern.sty
Package: lmodern 2015/05/01 v1.6.1 Latin Modern Fonts
LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
) (C:\Program Files\MiKTeX\tex/latex/amsmath\amsmath.sty
Package: amsmath 2022/04/08 v2.17n AMS math features
\@mathmargin=\skip49
For additional information on amsmath, use the `?' option.
(C:\Program Files\MiKTeX\tex/latex/amsmath\amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text
(C:\Program Files\MiKTeX\tex/latex/amsmath\amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks21
\ex@=\dimen141
)) (C:\Program Files\MiKTeX\tex/latex/amsmath\amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen142
) (C:\Program Files\MiKTeX\tex/latex/amsmath\amsopn.sty
Package: amsopn 2022/04/08 v2.04 operator names
)
\inf@bad=\count199
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count266
\leftroot@=\count267
LaTeX Info: Redefining \overline on input line 399.
LaTeX Info: Redefining \colon on input line 410.
\classnum@=\count268
\DOTSCASE@=\count269
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box52
\strutbox@=\box53
LaTeX Info: Redefining \big on input line 722.
LaTeX Info: Redefining \Big on input line 723.
LaTeX Info: Redefining \bigg on input line 724.
LaTeX Info: Redefining \Bigg on input line 725.
\big@size=\dimen143
LaTeX Font Info: Redeclaring font encoding OML on input line 743.
LaTeX Font Info: Redeclaring font encoding OMS on input line 744.
\macc@depth=\count270
LaTeX Info: Redefining \bmod on input line 905.
LaTeX Info: Redefining \pmod on input line 910.
LaTeX Info: Redefining \smash on input line 940.
LaTeX Info: Redefining \relbar on input line 970.
LaTeX Info: Redefining \Relbar on input line 971.
\c@MaxMatrixCols=\count271
\dotsspace@=\muskip16
\c@parentequation=\count272
\dspbrk@lvl=\count273
\tag@help=\toks22
\row@=\count274
\column@=\count275
\maxfields@=\count276
\andhelp@=\toks23
\eqnshift@=\dimen144
\alignsep@=\dimen145
\tagshift@=\dimen146
\tagwidth@=\dimen147
\totwidth@=\dimen148
\lineht@=\dimen149
\@envbody=\toks24
\multlinegap=\skip50
\multlinetaggap=\skip51
\mathdisplay@stack=\toks25
LaTeX Info: Redefining \[ on input line 2953.
LaTeX Info: Redefining \] on input line 2954.
) (C:\Program Files\MiKTeX\tex/latex/amsfonts\amssymb.sty
Package: amssymb 2013/01/14 v3.01 AMS font symbols
(C:\Program Files\MiKTeX\tex/latex/amsfonts\amsfonts.sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info: Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info: Overwriting math alphabet `\mathfrak' in version `bold'
(Font) U/euf/m/n --> U/euf/b/n on input line 106.
)) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/doublestroke\dsfont.sty
Package: dsfont 1995/08/01 v0.1 Double stroke roman fonts
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/setspace\setspace.sty
Package: setspace 2011/12/19 v6.7a set line spacing
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/tipa\tipa.sty
Package: tipa 2002/08/08 TIPA version 1.1
(C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
(C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/tipa\t3enc.def
File: t3enc.def 2001/12/31 T3 encoding
Now handling font encoding T3 ...
... no UTF-8 mapping file for font encoding T3
LaTeX Font Info: Trying to load font information for T1+lmss on input line 3
57.
(C:\Program Files\MiKTeX\tex/latex/lm\t1lmss.fd
File: t1lmss.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
))
LaTeX Font Info: Trying to load font information for T1+lmr on input line 11
2.
(C:\Program Files\MiKTeX\tex/latex/lm\t1lmr.fd
File: t1lmr.fd 2015/05/01 v1.6.1 Font defs for Latin Modern
))) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/relsize\relsize.sty
Package: relsize 2013/03/29 ver 4.1
) (C:\Program Files\MiKTeX\tex/latex/base\textcomp.sty
Package: textcomp 2020/02/02 v2.0n Standard LaTeX package
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/jknappen\mathrsfs.sty
Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)
\symrsfs=\mathgroup6
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/fundus-calligra\calligra.sty
Package: calligra 2012/04/10 v1.9 LaTeX package calligra
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/wasysym\wasysym.sty
Package: wasysym 2020/01/19 v2.4 Wasy-2 symbol support package
\symwasy=\mathgroup7
LaTeX Font Info: Overwriting symbol font `wasy' in version `bold'
(Font) U/wasy/m/n --> U/wasy/b/n on input line 93.
) (C:\Program Files\MiKTeX\tex/latex/ragged2e\ragged2e.sty
Package: ragged2e 2021/12/15 v3.1 ragged2e Package
\CenteringLeftskip=\skip52
\RaggedLeftLeftskip=\skip53
\RaggedRightLeftskip=\skip54
\CenteringRightskip=\skip55
\RaggedLeftRightskip=\skip56
\RaggedRightRightskip=\skip57
\CenteringParfillskip=\skip58
\RaggedLeftParfillskip=\skip59
\RaggedRightParfillskip=\skip60
\JustifyingParfillskip=\skip61
\CenteringParindent=\skip62
\RaggedLeftParindent=\skip63
\RaggedRightParindent=\skip64
\JustifyingParindent=\skip65
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/physics\physics.sty
Package: physics
(C:\Program Files\MiKTeX\tex/latex/l3packages/xparse\xparse.sty (C:\Program Fil
es\MiKTeX\tex/latex/l3kernel\expl3.sty
Package: expl3 2022-06-16 L3 programming layer (loader)
(C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-dvips.def
File: l3backend-dvips.def 2022-04-20 L3 backend support: dvips
\l__pdf_internal_box=\box54
\g__pdf_backend_object_int=\count277
\l__pdf_backend_content_box=\box55
\l__pdf_backend_model_box=\box56
\g__pdf_backend_annotation_int=\count278
\g__pdf_backend_link_int=\count279
\g__pdf_backend_link_sf_int=\count280
))
Package: xparse 2022-06-22 L3 Experimental document command parser
)) (C:\Program Files\MiKTeX\tex/latex/xcolor\xcolor.sty
Package: xcolor 2022/06/12 v2.14 LaTeX color extensions (UK)
(C:\Program Files\MiKTeX\tex/latex/graphics-cfg\color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: dvips.def on input line 227.
(C:\Program Files\MiKTeX\tex/latex/graphics-def\dvips.def
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex-dev/graphics\mathcolor.ltx)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1353.
Package xcolor Info: Model `RGB' extended on input line 1369.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1371.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1372.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1373.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1374.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1375.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1376.
) (C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/microtype\microtype.sty
Package: microtype 2022/06/23 v3.0f Micro-typographical refinements (RS)
(C:\Program Files\MiKTeX\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count281
)
\MT@toks=\toks26
\MT@tempbox=\box57
\MT@count=\count282
LaTeX Info: Redefining \noprotrusionifhmode on input line 1045.
LaTeX Info: Redefining \leftprotrusion on input line 1046.
LaTeX Info: Redefining \rightprotrusion on input line 1056.
LaTeX Info: Redefining \textls on input line 1234.
\MT@outer@kern=\dimen150
LaTeX Info: Redefining \textmicrotypecontext on input line 1858.
\MT@listname@count=\count283
(C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/microtype\microtype-pdftex.def
File: microtype-pdftex.def 2022/06/23 v3.0f Definitions specific to pdftex (RS)
LaTeX Info: Redefining \lsstyle on input line 900.
LaTeX Info: Redefining \lslig on input line 900.
\MT@outer@space=\skip66
)
Package microtype Info: Loading configuration file microtype.cfg.
(C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/microtype\microtype.cfg
File: microtype.cfg 2022/06/23 v3.0f microtype main configuration file (RS)
))
No file d946638dc8ff7097.aux.
\openout1 = `d946638dc8ff7097.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 24.
LaTeX Font Info: ... okay on input line 24.
LaTeX Font Info: Checking defaults for T3/cmr/m/n on input line 24.
LaTeX Font Info: Trying to load font information for T3+cmr on input line 24
.
(C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/tipa\t3cmr.fd
File: t3cmr.fd 2001/12/31 TIPA font definitions
)
LaTeX Font Info: ... okay on input line 24.
Preview: Fontsize 10pt
LaTeX Info: Redefining \microtypecontext on input line 24.
Package microtype Info: Applying patch `item' on input line 24.
Package microtype Info: Applying patch `toc' on input line 24.
Package microtype Info: Applying patch `eqnum' on input line 24.
Package microtype Info: Applying patch `footnote' on input line 24.
Package microtype Info: Generating DVI output.
Package microtype Info: Character protrusion enabled (level 2).
Package microtype Info: Using default protrusion set `alltext'.
Package microtype Info: No font expansion.
Package microtype Info: No adjustment of tracking.
Package microtype Info: No adjustment of interword spacing.
Package microtype Info: No adjustment of character kerning.
(C:\Users\selae\AppData\Roaming\MiKTeX\tex/latex/microtype\mt-cmr.cfg
File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman
(RS)
)
! Missing $ inserted.
<inserted text>
$
l.27 e^
{i heta}=\cos( heta)+i\sin( heta)
Here is how much of TeX's memory you used:
8382 strings out of 478352
131308 string characters out of 2846893
474783 words of memory out of 3000000
26693 multiletter control sequences out of 15000+600000
478062 words of font info for 34 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
72i,2n,77p,1025b,170s stack positions out of 10000i,1000n,20000p,200000b,80000s
No pages of output.
This code actually does work:
class I3(Scene):
def construct(self):
z = Tex("LaTeX")
self.add(z)
self.wait(5)
Which makes me believe there are some missing packages, after some digging around I've seen some people suggest to ran latex tex_template.tex
in the manimlib folder but I couldn't find this folder anywhere on my computer. What causes this problem and how can I fix it?
Upvotes: 0
Views: 1636
Reputation: 1161
You did not mention whether you are using manimgl or the community maintained version of Manim, but judging from the error I guess you are running the community maintained version (from manim import *
).
In that case, Tex
renders TeX in normal mode, and MathTex
inserts your string in an align*
-environment (and thus, in math mode). This is what the error towards the end of your log file complains about:
! Missing $ inserted.
<inserted text>
$
l.27 e^
{i heta}=\cos( heta)+i\sin( heta)
This actually also reveals a second problem with your code, given that \t
has been replaced by spaces: \
is a special character in Python strings; to actually write a \
you need to escape it by writing \\
-- or, alternatively, use a raw string by putting a r
before your string.
TL;DR, this is what you want:
class I3(Scene):
def construct(self):
z = MathTex(r"e^{i\theta}=\cos(\theta)+i\sin(\theta)")
self.add(z)
self.wait(5)
Upvotes: 2