question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Latex Error Converting DVI problem

See original GitHub issue

Hello, I have been choogling along with manim and am struggling like many to get the text functional. I managed to implement the changes suggested in #36 which is reiterated in several other threads. I am still able to run commands such as

python3 ./manim.py example_scenes.py SquareToCircle -pl

However, I am experiencing an error message relating to the fix involving TEX_DIR that I am unsure how to fix. I tried pointing directly to the Tex directory within manim but didn’t think that was consistent with the advice here either. My current tex_file_writing.py looks like:

def tex_to_dvi(tex_file):
    result = tex_file.replace(".tex", ".xdv")
    if not os.path.exists(result):
        commands = [
            "xelatex",
            "-no-pdf",
            "-interaction=batchmode",
            "-halt-on-error",
            "-output-directory=" TEX_DIR,
            tex_file,
            ">",
            get_null()
        ]
        exit_code = os.system(" ".join(commands))
        if exit_code != 0:
            log_file = tex_file.replace(".tex", ".log")
            raise Exception(
                "Latex error converting to dvi."
                "See log output above or the log file: %s" % log_file)
    return result   


def dvi_to_svg(dvi_file, regen_if_exists=False):
    """
    Converts a dvi, which potentially has multiple slides, into a
    directory full of enumerated pngs corresponding with these slides.
    Returns a list of PIL Image objects for these images sorted as they
    where in the dvi
    """
    result = dvi_file.replace(".xdv", ".svg")
    if not os.path.exists(result):
        commands = [
            "dvisvgm",
            dvi_file,
            "-n",
            "-v",
            "0",
            "-o",
            result,
            ">",
            get_null()
        ]
        os.system(" ".join(commands))
    return result

But, when I attempt to run

python3 ./manim.py example_scenes.py Write Stuff -pl

as a test,

Screen Shot 2019-06-28 at 10 55 19 PM

This is all I can muster. I can still run code not involving text. I tried messing around and removing the TEX_DIR portion, which yields the following message:

Screen Shot 2019-06-28 at 10 59 49 PM

I can’t wait to share my work if we can get through this! I appreciate everyone’s consideration.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AamodJcommented, Jul 5, 2019

I am running manim on OS X and I just cloned the repo and everything works fine (if you have all the dependencies right). I think you might have a wrong version of LaTeX. Did you install MikTeX or MacTeX? I’ve installed MacTeX by brew cask install mactex. If you don’t have MacTeX, try installing and trying again. And also, revert your tex_file_writing.py file to the latest one from https://github.com/3b1b/manim/blob/master/manimlib/utils/tex_file_writing.py

0reactions
gargVadercommented, Jul 14, 2019

i am having same problem. please help at #623

Read more comments on GitHub >

github_iconTop Results From Across the Web

Exception: Latex error converting to dvi. See log output above ...
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...
Read more >
Latex error converting to dvi : r/manim - Reddit
Sorry if this has been asked before but Im currently facing an issue with latex. Exception: Latex error converting to dvi. See log...
Read more >
Issues with Manim. 'error converting to dvi.' - Stack Overflow
We distinguish the two possible errors: Recognized the latex command but the compilation could not be completed because you are missing ...
Read more >
Source code for manim.utils.tex_file_writing - Docs
yield f"Install {matching[1]} it using your LaTeX package manager, ... e.g. ``.dvi`` or ``.pdf`` page Page to be converted if input file is...
Read more >
Latex or PdfLatex to generate DVI - TeX
The problems start when you try to view, print or convert to pdf: Then the dvi driver needs to find the image and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found