3b1b / manim

Animation engine for explanatory math videos
MIT License
61.91k stars 5.76k forks source link

Exception: Latex error converting to dvi. See log output above... #505

Open ostannick opened 5 years ago

ostannick commented 5 years ago

Let me start by saying that I've read through all of the other issues on here with the same error message, and have tried each of the fixes, but to no avail.

I was running example scene #1, and:

Traceback (most recent call last):
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\extract_scene.py", line 155, in main
    scene = SceneClass(**scene_kwargs)
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\scene\scene.py", line 52, in __init__
    self.construct()
  File "example_scenes.py", line 18, in construct
    title = TextMobject("This is some \\LaTeX")
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\mobject\svg\tex_mobject.py", line 145, in __init__
    self, self.arg_separator.join(tex_strings), **kwargs
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\mobject\svg\tex_mobject.py", line 45, in __init__
    self.template_tex_file_body
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\utils\tex_file_writing.py", line 19, in tex_to_svg_file
    dvi_file = tex_to_dvi(tex_file)
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\utils\tex_file_writing.py", line 67, in tex_to_dvi
    "See log output above or the log file: %s" % log_file)
Exception: Latex error converting to dvi. See log output above or the log file: C:\Users\kaneo\Desktop\manim\manim\manimlib\files\Tex\cc8b128e228b77ce.log

The 'log file' contains:

`\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}

\begin{document}

\centering This is some \LaTeX

\end{document}`

I'm on windows 10. This same error happens when I make my own custom scripts, but I am able to run example scenes 2 and 4.

eulertour commented 5 years ago

You're using latex inside a TextMobject. Use a TexMobject instead.

ostannick commented 5 years ago

You mean like this for example?

from big_ol_pile_of_manim_imports import *

class ColoringEquations(Scene):
    #Grouping and coloring parts of equations
    def construct(self):
        line1=TexMobject(r"\text{The vector } \vec{F}_{net} \text{ is the net }",r"\text{force }",r"\text{on object of mass }")
        line1.set_color_by_tex("force", BLUE)
        line2=TexMobject("m", "\\text{ and acceleration }", "\\vec{a}", ".  ")
        line2.set_color_by_tex_to_color_map({
            "m": YELLOW,
            "{a}": RED
        })
        sentence=VGroup(line1,line2)
        sentence.arrange_submobjects(DOWN, buff=MED_LARGE_BUFF)
        self.play(Write(sentence))

Still doesn't work

eulertour commented 5 years ago

Sorry about that, that should be valid even as a TextMobject. Since you're able to run examples 2 and 4, I suspect you are missing a latex package. The output you pasted seems to be a Tex file rather than a log file, is there a log file as well?

ostannick commented 5 years ago

There is no log file -- only .tex

eulertour commented 5 years ago

The file mentioned in the output cc8b128e228b77ce.log, isn't there? Or it only contains Tex?

ostannick commented 5 years ago

image

eulertour commented 5 years ago

Well, that's a problem.

I'd recommend trying to compile the Tex file from the command line, or using a graphical tool if you have one, so that you can see what's causing the error.

Elteoremadebeethoven commented 5 years ago

Try to change

\usepackage[english]{babel}

by

\usepackage[utf8]{inputenc}

in manimlib/tex_template.tex (line 3)

godiemp commented 5 years ago

Well, that's a problem.

I'd recommend trying to compile the Tex file from the command line, or using a graphical tool if you have one, so that you can see what's causing the error.

what are examples of graphical tools? thanks

quark67 commented 5 years ago

what are examples of graphical tools? thanks

TeXStudio, TexMaker, TeXshop are examples of graphical tools for compiling .tex files.

mathphysics commented 5 years ago

Is your \manim folder in a folder path that has a folder name with a space? That ended up being my issue. LaTeX works fine now.

ostannick commented 5 years ago

No, there are no spaces in my directory

Get Outlook for Androidhttps://aka.ms/ghei36


From: mathphysics notifications@github.com Sent: Wednesday, May 1, 2019 3:56:45 AM To: 3b1b/manim Cc: Nicholas Ostan; Author Subject: Re: [3b1b/manim] Exception: Latex error converting to dvi. See log output above... (#505)

Is your \manim folder in a folder path that has a folder name with a space? That ended up being my issue. LaTeX works fine now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/3b1b/manim/issues/505#issuecomment-488230271, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AKEEBBBGZGOHRGN6NUEKMATPTFEL3ANCNFSM4HGEY4UQ.

yoshiask commented 5 years ago

It sounds like you don't have LateX installed. Go to the LaTeX project website and download the suggested distribution for your OS.

Emory-Sun commented 5 years ago

I'm facing the exact same issue; when I try to run python -m manim example_scenes.py WriteStuff -pl, I get "See log output above..." with "Latex error converting to dvi." However, there is no log file ./media\Tex\e6984177d9d09224.log as indicated, only a .tex file of the same name. I have Tex Live installed and all the appropriate packages (I know this because I successfully managed to compile the .tex file independently). What's going on?

red5h4d0w commented 5 years ago

@Elteoremadebeethoven i tried changing that line but i still run into the exact problem they ran into

red5h4d0w commented 5 years ago

I found what needed to be fixed for this issue on my machine! Windows only takes double quotes around paths, so at line 47, 48, 56, 57, 82, 87 of manimlib/utils/tex_file_writing.py replace the escaped single quotes with double quotes If this doesn't impede development on other OS it should be corrected on master_branch

Digital-Down commented 4 years ago

Is your \manim folder in a folder path that has a folder name with a space? That ended up being my issue. LaTeX works fine now.

I've been working on this all day and this was my issue. You are awesome!

zombie110year commented 4 years ago

I met the same problem. I'm using Windows 10, and found it caused by TeX engines. In Windows, path seqerator is \ but TeX recognized it as a escape character. eg. ./media\Tex\fjkaljfa.tex will be ./mediaexjkaljfa.tex, the \T, \f have been wiped.

So replace \ to / before calling a TeX executable will solve this problem.

diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py
index 5df24de3..d8bbdad1 100644
--- a/manimlib/utils/tex_file_writing.py
+++ b/manimlib/utils/tex_file_writing.py
@@ -1,6 +1,8 @@
 import os
 import hashlib

+from pathlib import Path
+
 from manimlib.constants import TEX_TEXT_TO_REPLACE
 from manimlib.constants import TEX_USE_CTEX
 import manimlib.constants as consts
@@ -39,12 +41,15 @@ def generate_tex_file(expression, template_tex_file_body):

 def tex_to_dvi(tex_file):
     result = tex_file.replace(".tex", ".dvi" if not TEX_USE_CTEX else ".xdv")
+    result = Path(result).as_posix()
+    tex_file = Path(tex_file).as_posix()
+    tex_dir = Path(consts.TEX_DIR).as_posix()
     if not os.path.exists(result):
         commands = [
             "latex",
             "-interaction=batchmode",
             "-halt-on-error",
-            "-output-directory=\"{}\"".format(consts.TEX_DIR),
+            "-output-directory=\"{}\"".format(tex_dir),
             "\"{}\"".format(tex_file),
             ">",
             os.devnull
@@ -53,7 +58,7 @@ def tex_to_dvi(tex_file):
             "-no-pdf",
             "-interaction=batchmode",
             "-halt-on-error",
-            "-output-directory=\"{}\"".format(consts.TEX_DIR),
+            "-output-directory=\"{}\"".format(tex_dir),
             "\"{}\"".format(tex_file),
             ">",
             os.devnull
@@ -76,6 +81,8 @@ def dvi_to_svg(dvi_file, regen_if_exists=False):
     where in the dvi
     """
     result = dvi_file.replace(".dvi" if not TEX_USE_CTEX else ".xdv", ".svg")
+    result = Path(result).as_posix()
+    dvi_file = Path(dvi_file).as_posix()
     if not os.path.exists(result):
         commands = [
             "dvisvgm",

Did someone PR it?

Olivia-fsm commented 4 years ago

I met the same problem. I'm using Windows 10, and found it caused by TeX engines. In Windows, path seqerator is \ but TeX recognized it as a escape character. eg. ./media\Tex\fjkaljfa.tex will be ./mediaexjkaljfa.tex, the \T, \f have been wiped. So replace \ to / before calling a TeX executable will solve this problem. diff --git a/manimlib/utils/tex_file_writing.py b/manimlib/utils/tex_file_writing.py index 5df24de3..d8bbdad1 100644 --- a/manimlib/utils/tex_file_writing.py +++ b/manimlib/utils/tex_file_writing.py @@ -1,6 +1,8 @@ import os import hashlib

+from pathlib import Path + from manimlib.constants import TEX_TEXT_TO_REPLACE from manimlib.constants import TEX_USE_CTEX import manimlib.constants as consts @@ -39,12 +41,15 @@ def generate_tex_file(expression, template_tex_file_body):

def tex_to_dvi(tex_file): result = tex_file.replace(".tex", ".dvi" if not TEX_USE_CTEX else ".xdv")

  • result = Path(result).as_posix()
  • tex_file = Path(tex_file).as_posix()
  • tex_dir = Path(consts.TEX_DIR).as_posix() if not os.path.exists(result): commands = [ "latex", "-interaction=batchmode", "-halt-on-error",
  • "-output-directory=\"{}\"".format(consts.TEX_DIR),
  • "-output-directory=\"{}\"".format(tex_dir), "\"{}\"".format(tex_file), ">", os.devnull @@ -53,7 +58,7 @@ def tex_to_dvi(tex_file): "-no-pdf", "-interaction=batchmode", "-halt-on-error",
  • "-output-directory=\"{}\"".format(consts.TEX_DIR),
  • "-output-directory=\"{}\"".format(tex_dir), "\"{}\"".format(tex_file), ">", os.devnull @@ -76,6 +81,8 @@ def dvi_to_svg(dvi_file, regen_if_exists=False): where in the dvi """ result = dvi_file.replace(".dvi" if not TEX_USE_CTEX else ".xdv", ".svg")
  • result = Path(result).as_posix()
  • dvi_file = Path(dvi_file).as_posix() if not os.path.exists(result): commands = [ "dvisvgm", Did someone PR it?

but if I change this file follow the instruction, I got this error: OSError: No file matching media/Tex/01339147c3b11af9.svg in image directory What can I do then...

f1rstmehul commented 4 years ago

I had same problem and I tried all the solution listed above but didn't worked for me. I came to know that error was due to some missing packages. I uninstalled MikTex and installed again but chose to install missing packages on the fly while installing.

Screenshot (4)

It worked fine for me.

MeatBoyed commented 4 years ago

Getting a new environment and removing any other installations of MikTeX and following this tutorial exactly worked for me.

If you encounter a pop up message after running python -m manim example_scenes.py WriteStuff -pl saying there are MikTeX packages missing. Exit the session, run MikTeX console with admin privileges, go to the Packages section here: Annotation 2020-06-23 125517

sanskrutikarnawat commented 4 years ago

Getting a new environment and removing any other installations of MikTeX and following this tutorial exactly worked for me.

If you encounter a pop up message after running python -m manim example_scenes.py WriteStuff -pl saying there are MikTeX packages missing. Exit the session, run MikTeX console with admin privileges, go to the Packages section here: Annotation 2020-06-23 125517

  • and search for the package that is required and install them/it. Everything should work as expected from there on out.

How do you search for required packages?

zdarovakoresh commented 4 years ago

I'm facing the same issue. I have a complete version of MikTex on my computer.

Here is the log file:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.6.29) (preloaded format=latex 2020.7.28)  13 AUG 2020 02:03
entering extended mode
**./media/Tex/89b56776460a3453.tex
(media/Tex/89b56776460a3453.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-06-18> ("C:\Program Files\MiKTeX\tex/latex/standalon
e\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 2020/03/06 v1.0d TeX engine tests
)) ("C:\Program Files\MiKTeX\tex/latex/xkeyval\xkeyval.sty"
Package: xkeyval 2014/12/03 v2.7a package option processing (HA)
("C:\Program Files\MiKTeX\tex/generic/xkeyval\xkeyval.tex" ("C:\Program Files\M
iKTeX\tex/generic/xkeyval\xkvutils.tex"
\XKV@toks=\toks15
\XKV@tempa@toks=\toks16
("C:\Program Files\MiKTeX\tex/generic/xkeyval\keyval.tex"))
\XKV@depth=\count167
File: xkeyval.tex 2014/12/03 v2.7a key=value parser (HA)
))
\sa@internal=\count168
\c@sapage=\count169
("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 2019/12/20 v1.4l Standard LaTeX document class
("C:\Program Files\MiKTeX\tex/latex/base\size10.clo"
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count170
\c@section=\count171
\c@subsection=\count172
\c@subsubsection=\count173
\c@paragraph=\count174
\c@subparagraph=\count175
\c@figure=\count176
\c@table=\count177
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
) ("C:\Program Files\MiKTeX\tex/latex/preview\preview.sty"
Package: preview 2017/04/24 11.91 (AUCTeX/preview-latex)
("C:\Program Files\MiKTeX\tex/generic/luatex85\luatex85.sty"
Package: luatex85 2016/06/15 v1.4 pdftex aliases for luatex
) ("C:\Program Files\MiKTeX\tex/latex/preview\prtightpage.def"
\PreviewBorder=\dimen135
)
\pr@snippet=\count178
\pr@box=\box45
\pr@output=\toks17
)) ("C:\Program Files\MiKTeX\tex/generic/babel\babel.sty"
Package: babel 2020/06/10 3.45 The Babel package
("C:\Program Files\MiKTeX\tex/generic/babel\babel.def"
File: babel.def 2020/06/10 3.45 Babel common definitions
\babel@savecnt=\count179
\U@D=\dimen136
\l@babelnohyphens=\language79
("C:\Program Files\MiKTeX\tex/generic/babel\txtbabel.def")
\bbl@readstream=\read2
)
\bbl@dirlevel=\count180
*************************************
* 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: \l@canadian = using hyphenrules for english
(babel)             (\language0) on input line 102.
Package babel Info: \l@australian = using hyphenrules for ukenglish
(babel)             (\language73) on input line 105.
Package babel Info: \l@newzealand = using hyphenrules for ukenglish
(babel)             (\language73) on input line 108.
)) ("C:\Program Files\MiKTeX\tex/latex/base\inputenc.sty"
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks18
\inpenc@posthook=\toks19
) ("C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty"
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
) ("C:\Program Files\MiKTeX\tex/latex/amsmath\amsmath.sty"
Package: amsmath 2020/01/20 v2.17e AMS math features
\@mathmargin=\skip49
For additional information on amsmath, use the `?' option.
("C:\Program Files\MiKTeX\tex/latex/amsmath\amstext.sty"
Package: amstext 2000/06/29 v2.01 AMS text
("C:\Program Files\MiKTeX\tex/latex/amsmath\amsgen.sty"
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks20
\ex@=\dimen137
)) ("C:\Program Files\MiKTeX\tex/latex/amsmath\amsbsy.sty"
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen138
) ("C:\Program Files\MiKTeX\tex/latex/amsmath\amsopn.sty"
Package: amsopn 2016/03/08 v2.02 operator names
)
\inf@bad=\count181
LaTeX Info: Redefining \frac on input line 227.
\uproot@=\count182
\leftroot@=\count183
LaTeX Info: Redefining \overline on input line 389.
\classnum@=\count184
\DOTSCASE@=\count185
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\Mathstrutbox@=\box46
\strutbox@=\box47
\big@size=\dimen139
LaTeX Font Info:    Redeclaring font encoding OML on input line 733.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 734.
\macc@depth=\count186
\c@MaxMatrixCols=\count187
\dotsspace@=\muskip16
\c@parentequation=\count188
\dspbrk@lvl=\count189
\tag@help=\toks21
\row@=\count190
\column@=\count191
\maxfields@=\count192
\andhelp@=\toks22
\eqnshift@=\dimen140
\alignsep@=\dimen141
\tagshift@=\dimen142
\tagwidth@=\dimen143
\totwidth@=\dimen144
\lineht@=\dimen145
\@envbody=\toks23
\multlinegap=\skip50
\multlinetaggap=\skip51
\mathdisplay@stack=\toks24
LaTeX Info: Redefining \[ on input line 2859.
LaTeX Info: Redefining \] on input line 2860.
) ("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:\Program Files\MiKTeX\tex/latex/doublestroke\dsfont.sty"
Package: dsfont 1995/08/01 v0.1 Double stroke roman fonts
) ("C:\Program Files\MiKTeX\tex/latex/setspace\setspace.sty"
Package: setspace 2011/12/19 v6.7a set line spacing
) ("C:\Program Files\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 2020/02/11 v2.0o Standard LaTeX package
("C:\Program Files\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+cmss on input line 3
57.
("C:\Program Files\MiKTeX\tex/latex/base\t1cmss.fd"
File: t1cmss.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)))) ("C:\Program Files\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:\Program Files\MiKTeX\tex/latex/jknappen\mathrsfs.sty"
Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)
\symrsfs=\mathgroup6
) ("C:\Program Files\MiKTeX\tex/latex/fundus-calligra\calligra.sty"
Package: calligra 2012/04/10 v1.9 LaTeX package calligra
) ("C:\Program Files\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 2019/07/28 v2.2 ragged2e Package (MS)
("C:\Program Files\MiKTeX\tex/latex/ms\everysel.sty"
Package: everysel 2011/10/28 v1.2 EverySelectfont Package (MS)
)
\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:\Program Files\MiKTeX\tex/latex/physics\physics.sty"
Package: physics 
("C:\Program Files\MiKTeX\tex/latex/l3packages/xparse\xparse.sty" ("C:\Program 
Files\MiKTeX\tex/latex/l3kernel\expl3.sty"
Package: expl3 2020-06-18 L3 programming layer (loader) 
("C:\Program Files\MiKTeX\tex/latex/l3backend\l3backend-dvips.def"
File: l3backend-dvips.def 2020-06-29 L3 backend support: dvips
\l__pdf_internal_box=\box48
\g__pdf_backend_object_int=\count193
\l__pdf_backend_content_box=\box49
\l__pdf_backend_model_box=\box50
\g__pdf_backend_annotation_int=\count194
\g__pdf_backend_link_int=\count195
\g__pdf_backend_link_sf_int=\count196
))
Package: xparse 2020-05-15 L3 Experimental document command parser
("C:\Program Files\MiKTeX\tex/latex/l3packages/xparse\xparse-generic.tex"
\l__xparse_current_arg_int=\count197
\g__xparse_grabber_int=\count198
\l__xparse_m_args_int=\count199
\l__xparse_v_nesting_int=\count266
))) ("C:\Program Files\MiKTeX\tex/latex/xcolor\xcolor.sty"
Package: xcolor 2016/05/11 v2.12 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 225.
("C:\Program Files\MiKTeX\tex/latex/graphics-def\dvips.def"
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
) ("C:\Program Files\MiKTeX\tex/latex/microtype\microtype.sty"
Package: microtype 2019/11/18 v2.7d Micro-typographical refinements (RS)
\MT@toks=\toks25
\MT@count=\count267
LaTeX Info: Redefining \textls on input line 790.
\MT@outer@kern=\dimen146
LaTeX Info: Redefining \textmicrotypecontext on input line 1354.
\MT@listname@count=\count268
("C:\Program Files\MiKTeX\tex/latex/microtype\microtype-pdftex.def"
File: microtype-pdftex.def 2019/11/18 v2.7d Definitions specific to pdftex (RS)

LaTeX Info: Redefining \lsstyle on input line 914.
LaTeX Info: Redefining \lslig on input line 914.
\MT@outer@space=\skip66
)
Package microtype Info: Loading configuration file microtype.cfg.
("C:\Program Files\MiKTeX\tex/latex/microtype\microtype.cfg"
File: microtype.cfg 2019/11/18 v2.7d microtype main configuration file (RS)
)) ("C:\Program Files\Manim\media\Tex\89b56776460a3453.aux")
\openout1 = `89b56776460a3453.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:\Program Files\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
ABD: EverySelectfont initializing macros
LaTeX Info: Redefining \selectfont on input line 24.
LaTeX Info: Redefining \microtypecontext 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:\Program Files\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.26 \centering _
                 {\quad} 
Here is how much of TeX's memory you used:
 7322 strings out of 480791
 108305 string characters out of 2907084
 401929 words of memory out of 3000000
 23239 multiletter control sequences out of 15000+200000
 536143 words of font info for 29 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 44i,1n,60p,354b,159s stack positions out of 5000i,500n,10000p,200000b,50000s

No pages of output.
Dfredude commented 3 years ago

Hey man I was having the same issue and the issue was with my code. It was like this: from big_ol_pile_of_manim_imports import * class Formula(Scene): def construct(self): formula_tex1=TexMobject(r"\frac{d}{dx}f(x)=\lim{h\rightarrow 0}{\frac{f(x+h)-f(x)}{h}}") self.add(formula_tex_2)

And i changed it to this: from big_ol_pile_of_manim_imports import * class Formula(Scene): def construct(self): formula_tex2=TexMobject("\frac{d}{dx}f(x)=\lim{h\rightarrow 0}{\frac{f(x+h)-f(x)}{h}}") self.add(formula_tex_2) As you can see I used backslash instead of r and that at least let me render the image. Nothing fancy but might help somebody new to this like me.

mati-caliz commented 3 years ago

I had the same problem and I solved it by changing TextMobject for TexMobject, and correcting one mistake I had. I think that's the problem you have.

jeemitsha commented 3 years ago

Let me start by saying that I've read through all of the other issues on here with the same error message, and have tried each of the fixes, but to no avail.

I was running example scene #1, and:

Traceback (most recent call last):
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\extract_scene.py", line 155, in main
    scene = SceneClass(**scene_kwargs)
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\scene\scene.py", line 52, in __init__
    self.construct()
  File "example_scenes.py", line 18, in construct
    title = TextMobject("This is some \\LaTeX")
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\mobject\svg\tex_mobject.py", line 145, in __init__
    self, self.arg_separator.join(tex_strings), **kwargs
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\mobject\svg\tex_mobject.py", line 45, in __init__
    self.template_tex_file_body
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\utils\tex_file_writing.py", line 19, in tex_to_svg_file
    dvi_file = tex_to_dvi(tex_file)
  File "C:\Users\kaneo\Desktop\manim\manim\manimlib\utils\tex_file_writing.py", line 67, in tex_to_dvi
    "See log output above or the log file: %s" % log_file)
Exception: Latex error converting to dvi. See log output above or the log file: C:\Users\kaneo\Desktop\manim\manim\manimlib\files\Tex\cc8b128e228b77ce.log

The 'log file' contains:

`\documentclass[preview]{standalone}

\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{textcomp}
\usepackage{microtype}
\DisableLigatures{encoding = *, family = * }
%\usepackage[UTF8]{ctex}
\linespread{1}

\begin{document}

\centering This is some \LaTeX

\end{document}`

I'm on windows 10. This same error happens when I make my own custom scripts, but I am able to run example scenes 2 and 4.

Did you find any solution?

ai-bites commented 3 years ago

I was able to solve this problem by doing a full install of Latex in Ubuntu:

sudo apt-get install texlive-full

Hope it helps!

aarongraybill commented 3 years ago

For whatever this is worth, if you've previously installed TinyTeX for R markdown compilation, it produces the aforementioned .dvi error (while still producing the log output). In fact, when the log produces a babel package error saying there is no "english" option for the babel package. Running the following in my R console fixed the problem for me:

tinytex::uninstall_tinytex()
kneardhead commented 3 years ago

Hey there, I had the similar problem. None of the above worked because my problem was somewhere else,

I had the similar issue, here, basically the error message means there is some error compiling the tex.

If you have several lines of text, then check the .tex file made after trying to compile the code. Mine was c2f123b87baffd8.tex. Now check the code, I found it had,

\begin{align} $$\text{Hello}$$ \end{align}

certainly this is scandal if you know latex, I went to the .py file immediately and removed the $$ from the text. This later solved my issue.

I hope this helps

djkinger commented 2 years ago

Instead of using Tex(for community version) or TexMobject simply use MathTex. See if this resolves your issue.

billy-ijk commented 1 year ago

like @kneardhead i thought my problem was with manim but i just had some misspelled latex code

MathTex(r"\left(\begin{array}{cc} 1 & 2 \\ 3 & 4 \right)")

I forgot to put \end{array} as you can see.

DungLai commented 1 year ago

Is your \manim folder in a folder path that has a folder name with a space? That ended up being my issue. LaTeX works fine now.

Not only space, but the folder name also should not contain numbers as well.

rudransh61 commented 1 year ago

use MathTex(r" your Latex") or TexMobject(r" ur latex") it will surely work😄

Calculuscc commented 9 months ago

Hey there, I had the similar problem. None of the above worked because my problem was somewhere else,

I had the similar issue, here, basically the error message means there is some error compiling the tex.

If you have several lines of text, then check the .tex file made after trying to compile the code. Mine was c2f123b87baffd8.tex. Now check the code, I found it had,

\begin{align*} $$\text{Hello}$$ \end{align*} certainly this is scandal if you know latex, I went to the .py file immediately and removed the $$ from the text. This later solved my issue.

I hope this helps

It does work a lot, thank you much