Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Your installation does not support converting .xdv files to SVG. Consider updating dvisvgm to at least version 2.4. #3301

Closed
MarkHoo opened this issue Jul 20, 2023 · 7 comments

Comments

@MarkHoo
Copy link

MarkHoo commented Jul 20, 2023

Description of bug / unexpected behavior

weird baseline issue in multilanguage LaTeX objects

When dealing with the above problem, it was found that this problem was caused by a bug in dvisvgm. But after I installed the latest dvisvgm, new problems appeared. Details are in the buglog below

Expected behavior

image

How to reproduce the issue

Code for reproducing the problem
from manim import *

class LaTeXTemplateLibrary(Scene):
    def construct(self):
        tex = Tex('Hello 你好 \\LaTeX', tex_template=TexTemplateLibrary.ctex, font_size=144)
        self.add(tex)

Additional media files

Images/GIFs

Logs

Terminal output
Manim Community v0.17.3

┌─────────────────────────────── Traceback (most recent call last) ────────────────────────────────┐
│ C:\Python39\lib\site-packages\manim\cli\render\commands.py:115 in render                         │
│                                                                                                  │
│   112 │   │   │   try:                                                                           │
│   113 │   │   │   │   with tempconfig({}):                                                       │
│   114 │   │   │   │   │   scene = SceneClass()                                                   │
│ > 115 │   │   │   │   │   scene.render()                                                         │
│   116 │   │   │   except Exception:                                                              │
│   117 │   │   │   │   error_console.print_exception()                                            │
│   118 │   │   │   │   sys.exit(1)                                                                │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\scene\scene.py:223 in render                                 │
│                                                                                                  │
│    220 │   │   """                                                                               │
│    221 │   │   self.setup()                                                                      │
│    222 │   │   try:                                                                              │
│ >  223 │   │   │   self.construct()                                                              │
│    224 │   │   except EndSceneEarlyException:                                                    │
│    225 │   │   │   pass                                                                          │
│    226 │   │   except RerunSceneException as e:                                                  │
│                                                                                                  │
│ D:\pycode\coding\demo2.py:15 in construct                                                        │
│                                                                                                  │
│   12                                                                                             │
│   13 class LaTeXTemplateLibrary(Scene):                                                          │
│   14 │   def construct(self):                                                                    │
│ > 15 │   │   tex = Tex('Hello 你好世界 \\LaTeX', tex_template=TexTemplateLibrary.ctex, font_s    │
│   16 │   │   self.add(tex)                                                                       │
│   17                                                                                             │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\mobject\text\tex_mobject.py:449 in __init__                  │
│                                                                                                  │
│   446 │   def __init__(                                                                          │
│   447 │   │   self, *tex_strings, arg_separator="", tex_environment="center", **kwargs           │
│   448 │   ):                                                                                     │
│ > 449 │   │   super().__init__(                                                                  │
│   450 │   │   │   *tex_strings,                                                                  │
│   451 │   │   │   arg_separator=arg_separator,                                                   │
│   452 │   │   │   tex_environment=tex_environment,                                               │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\mobject\text\tex_mobject.py:295 in __init__                  │
│                                                                                                  │
│   292 │   │   │   │   │   │   """,                                                               │
│   293 │   │   │   │   │   ),                                                                     │
│   294 │   │   │   │   )                                                                          │
│ > 295 │   │   │   raise compilation_error                                                        │
│   296 │   │   self.set_color_by_tex_to_color_map(self.tex_to_color_map)                          │
│   297 │   │                                                                                      │
│   298 │   │   if self.organize_left_to_right:                                                    │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\mobject\text\tex_mobject.py:274 in __init__                  │
│                                                                                                  │
│   271 │   │   self.brace_notation_split_occurred = False                                         │
│   272 │   │   self.tex_strings = self._break_up_tex_strings(tex_strings)                         │
│   273 │   │   try:                                                                               │
│ > 274 │   │   │   super().__init__(                                                              │
│   275 │   │   │   │   self.arg_separator.join(self.tex_strings),                                 │
│   276 │   │   │   │   tex_environment=self.tex_environment,                                      │
│   277 │   │   │   │   tex_template=self.tex_template,                                            │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\mobject\text\tex_mobject.py:83 in __init__                   │
│                                                                                                  │
│    80 │   │                                                                                      │
│    81 │   │   assert isinstance(tex_string, str)                                                 │
│    82 │   │   self.tex_string = tex_string                                                       │
│ >  83 │   │   file_name = tex_to_svg_file(                                                       │
│    84 │   │   │   self._get_modified_expression(tex_string),                                     │
│    85 │   │   │   environment=self.tex_environment,                                              │
│    86 │   │   │   tex_template=self.tex_template,                                                │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\utils\tex_file_writing.py:59 in tex_to_svg_file              │
│                                                                                                  │
│    56 │   │   tex_template.tex_compiler,                                                         │
│    57 │   │   tex_template.output_format,                                                        │
│    58 │   )                                                                                      │
│ >  59 │   return convert_to_svg(dvi_file, tex_template.output_format)                            │
│    60                                                                                            │
│    61                                                                                            │
│    62 def generate_tex_file(                                                                     │
│                                                                                                  │
│ C:\Python39\lib\site-packages\manim\utils\tex_file_writing.py:243 in convert_to_svg              │
│                                                                                                  │
│   240 │                                                                                          │
│   241 │   # if the file does not exist now, this means conversion failed                         │
│   242 │   if not result.exists():                                                                │
│ > 243 │   │   raise ValueError(                                                                  │
│   244 │   │   │   f"Your installation does not support converting {dvi_file.suffix} files to S   │
│   245 │   │   │   f" Consider updating dvisvgm to at least version 2.4."                         │
│   246 │   │   │   f" If this does not solve the problem, please refer to our troubleshooting g   │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
ValueError: Your installation does not support converting .xdv files to SVG. Consider updating dvisvgm to at least
version 2.4. If this does not solve the problem, please refer to our troubleshooting guide at:
https://docs.manim.community/en/stable/faq/general.html#my-installation-does-not-support-converting-pdf-to-svg-help

System specifications

System Details
  • OS:Windows 10 22H2
  • Python version:python3.9.13
  • Installed modules: manim 0.17.3
  • LaTeX distribution:TeX Live 2023
  • dvisvgm version:dvisvgm 3.1
FFMPEG

Output of ffmpeg -version:

ffmpeg version 2023-06-08-git-024c30aa3b-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      58. 12.100 / 58. 12.100
libavcodec     60. 17.100 / 60. 17.100
libavformat    60.  6.100 / 60.  6.100
libavdevice    60.  2.100 / 60.  2.100
libavfilter     9.  8.101 /  9.  8.101
libswscale      7.  3.100 /  7.  3.100
libswresample   4. 11.100 /  4. 11.100
libpostproc    57.  2.100 / 57.  2.100

Additional comments

@MarkHoo
Copy link
Author

MarkHoo commented Jul 20, 2023

When I switched to miktex and the dvisvgm version was 3.1, the error disappeared.

However, how do I continue to use normally under livetex.

@uwezi
Copy link
Contributor

uwezi commented Jul 20, 2023

Why do you want to use TexLive instead of MikTex?
But essentially you just need to swap out the dvisvgm executable in either LaTeX installation... On Windows this would be the 64bit dvisvgm.exe which needs to be placed somewhere where it is found by your operating system - and it has to be the first file with this name to be found.
On my MikTex this was
C:\Program Files\MiKTeX 2.9\miktex\bin\x64\dvisvgm.exe

@MarkHoo
Copy link
Author

MarkHoo commented Jul 20, 2023

The reason why I use livetex instead of miktex is that miktex downloads and installs missing files on demand, which feels a bit cumbersome. But now I switched to miktex and installed all packages at once.

I checked the documentation on the official website of dvisvgm. Only when the dvisvgm -l command can run normally, it means that the conversion svg function can be used normally. If the error miktex session... is reported, it means that the conversion svg function cannot be used normally. Therefore, miktex must be installed before it can run normally. In this case, it is almost equivalent to "dvisvgm" bound to miktex, because miktex must be installed to run normally.

My solution is to manually upgrade dvisvgm in livetex to version 3.1, then install miktex and update. Finally, modify livetex in the environment variable and put it in front of miktex.

Finally, I want to say that the best solution is to use miktex directly, just upgrade the dvisvgm version to 3.1.

@uwezi
Copy link
Contributor

uwezi commented Jul 20, 2023

But isn't it an advantage of MikTex to install missing packages on the fly - in contrast to TexLive?
Also in my opinion upgrading your packages and system using the MikTex GUI is a bit easier than using a command line interface. On the other hand I am biased and have been using MikTex for more than 20 years by now...

@MarkHoo
Copy link
Author

MarkHoo commented Jul 20, 2023

I also like the miktex way of downloading software packages on demand, but I didn't set up the retrieval source mirror before, resulting in slow downloads. Now, I'm ready to switch back!

Thank you

@MarkHoo MarkHoo closed this as completed Jul 20, 2023
@rsj001
Copy link

rsj001 commented Jul 22, 2023

Installing MiKTeX in single user mode causes this problem as well
after countless attempts
mgieseki/dvisvgm#41

@MarkHoo
Copy link
Author

MarkHoo commented Jul 22, 2023

Installing MiKTeX in single user mode causes this problem as well after countless attempts mgieseki/dvisvgm#41

You should install using administrator mode. Then open "miktex console".
Then click "Switch to miktex administrator mode", and then click Update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants