program brakes on "full_tex_to_svg" method
- Dominant language
- Python
- Stars
- 93.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
### Describe the bug
When running ManimGL with MiKTeX on Windows, the LaTeX subprocess fails due to the `-no-pdf` option, which is not supported by certain versions of MiKTeX. This results in an error during LaTeX compilation, preventing the rendering of scenes that use LaTeX, such as Tex or MathTex.
``` python
from manimlib import *
class LatexTest(Scene):
def construct(self):
text = Tex("Hello, World!")
self.add(text)
self.wait()
```
### Error:
with the above code i got the following error which is not related to the issue
``` terminal
in full_tex_to_svg
raise LatexError(error_str or "LaTeX compilation failed")
manimlib.utils.tex_file_writing.LatexError: LaTeX compilation failed
```
### Code Snippet:
In the following path: `Lib\site-packages\manimlib\utils\tex_file_writing.py`, inside the `full_tex_to_svg` method, it creates a subprocess and the `-no-pdf` option is passed as an argument:
``` python
#the manimgl source code inside the full_tex_to_svg method
process = subprocess.run(
[
compiler,
'no-pdf', #where the issue comes from
"-interaction=batchmode",
"-halt-on-error",
f"-output-directory={temp_dir}",
tex_path
],
capture_output=True,
text=True
)
```
### How to solve the problem and why it's happening
Since ManimGL uses the `latex` command to create the SVG file, the output of the `latex` command is never going to be a PDF file, so the `no-pdf` option is not recognized. To have a PDF file as output, you should use the `pdflatex` command.
To overcome the issue, you need to remove the `-no-pdf` argument in the `full_tex_to_svg` method located inside the `Lib\site-packages\manimlib\utils\tex_file_writing.py` file, and the issue should be resolved.
### Additional context
Environment:
Operating System: Windows 10
ManimGL Version: 1.7.2
MiKTeX Version: 24.4
Python Version: 3.x
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.