fix: latex compilation error on windows#2463
Open
Diogo1703Silva wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: LaTeX compilation error on Windows (#2002)
Summary
Fixes a Windows-specific bug where
full_tex_to_svg()incorrectly raisesLatexErroreven when LaTeX compilation succeeds and the DVI file is produced. This prevented any scene usingTex,MathTex, orMatrixobjects from rendering on Windows.Root cause
TeX Live / TinyTeX on Windows returns a non-zero exit code from
subprocess.run()withcapture_output=True, even on successful compilation. The old logic treated any non-zero exit code as a failure.Fix
Added a second condition to the error check in
manimlib/utils/tex_file_writing.py:Before:
After:
A missing DVI file unambiguously indicates genuine compilation failure. If the DVI exists, compilation succeeded regardless of exit code, and the pipeline continues to
dvisvgm.Files changed
manimlib/utils/tex_file_writing.py— core fix infull_tex_to_svg()Preconditions to reproduce the issue
latexanddvisvgmonPATHTex,MathTex, orMatrixobjects