-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added dvips
to list of required LaTeX packages on Linux
#2371
Added dvips
to list of required LaTeX packages on Linux
#2371
Conversation
I am a bit confused about this: our Docker images work, but do not have the |
(TL;DR at bottom) Steps to reproduceI installed Manim using I tried to compile the following scene: from manim import *
class TestScene(Scene):
def construct(self):
t = MathTex(r'\mathbb{M}').scale(7)
self.add(t) Observed errorIt resulted in the following error: $ manim -pqh scene.py TestScene
Manim Community v0.13.1
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ │
│ /home/..../.local/lib/python3.10/site-packages/manim/cli/render/commands.py:139 in render │
│ │
│ 136 │ │ for SceneClass in scene_classes_from_file(file): │
│ 137 │ │ │ try: │
│ 138 │ │ │ │ scene = SceneClass() │
│ ❱ 139 │ │ │ │ scene.render() │
│ 140 │ │ │ except Exception: │
│ 141 │ │ │ │ error_console.print_exception() │
│ 142 │ │ │ │ sys.exit(1) │
│ /home/..../.local/lib/python3.10/site-packages/manim/scene/scene.py:219 in render │
│ │
│ 216 │ │ """ │
│ 217 │ │ self.setup() │
│ 218 │ │ try: │
│ ❱ 219 │ │ │ self.construct() │
│ 220 │ │ except EndSceneEarlyException: │
│ 221 │ │ │ pass │
│ 222 │ │ except RerunSceneException as e: │
│ │
│ /home/..../downloads/manim/scene.py:5 in construct │
│ │
│ 2 │
│ 3 class TestScene(Scene): │
│ 4 │ def construct(self): │
│ ❱ 5 │ │ t = MathTex(r'\mathbb{M}').scale(7) │
│ 6 │ │ self.add(t) │
│ 7 │
│ │
│ /home/.../.local/lib/python3.10/site-packages/manim/mobject/svg/tex_mobject.py:304 in __init__ │
│ │
│ 301 │ │ │ │ │ │ """, │
│ 302 │ │ │ │ │ ), │
│ 303 │ │ │ │ ) │
│ ❱ 304 │ │ │ raise compilation_error │
│ 305 │ │ self.set_color_by_tex_to_color_map(self.tex_to_color_map) │
│ 306 │ │ │
│ 307 │ │ if self.organize_left_to_right: │
│ │
│ /home/..../.local/lib/python3.10/site-packages/manim/mobject/svg/tex_mobject.py:283 in __init__ │
│ │
│ 280 │ │ self.brace_notation_split_occurred = False │
│ 281 │ │ self.tex_strings = self.break_up_tex_strings(tex_strings) │
│ 282 │ │ try: │
│ ❱ 283 │ │ │ super().__init__( │
│ 284 │ │ │ │ self.arg_separator.join(self.tex_strings), │
│ 285 │ │ │ │ tex_environment=self.tex_environment, │
│ 286 │ │ │ │ tex_template=self.tex_template, │
│ │
│ /home/..../.local/lib/python3.10/site-packages/manim/mobject/svg/tex_mobject.py:90 in __init__ │
│ │
│ 87 │ │ │
│ 88 │ │ assert isinstance(tex_string, str) │
│ 89 │ │ self.tex_string = tex_string │
│ ❱ 90 │ │ file_name = tex_to_svg_file( │
│ 91 │ │ │ self.get_modified_expression(tex_string), │
│ 92 │ │ │ environment=self.tex_environment, │
│ 93 │ │ │ tex_template=self.tex_template, │
│ │
│ /home/..../.local/lib/python3.10/site-packages/manim/utils/tex_file_writing.py:51 in │
│ tex_to_svg_file │
│ │
│ 48 │ │ tex_template.tex_compiler, │
│ 49 │ │ tex_template.output_format, │
│ 50 │ ) │
│ ❱ 51 │ return convert_to_svg(dvi_file, tex_template.output_format) │
│ 52 │
│ 53 │
│ 54 def generate_tex_file(expression, environment=None, tex_template=None): │
│ │
│ /home/..../.local/lib/python3.10/site-packages/manim/utils/tex_file_writing.py:226 in │
│ convert_to_svg │
│ │
│ 223 │ │
│ 224 │ # if the file does not exist now, this means conversion failed │
│ 225 │ if not os.path.exists(result): │
│ ❱ 226 │ │ raise ValueError( │
│ 227 │ │ │ f"Your installation does not support converting {extension} files to SVG." │
│ 228 │ │ │ f" Consider updating dvisvgm to at least version 2.4." │
│ 229 │ │ │ f" If this does not solve the problem, please refer to our troubleshooting g │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Your installation does not support converting .dvi 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/installation/troubleshooting.html Doing some diggingHowever, my $ dvisvgm media/Tex/d542770d69a4bbe7.dvi
pre-processing DVI file (format version 2)
WARNING: PostScript header file tex.pro not found
WARNING: PostScript header file texps.pro not found
WARNING: PostScript header file special.pro not found
WARNING: PostScript header file color.pro not found
PostScript error: undefined in TeXDict Searching for one of those missing files using $ tlmgr search --global --file /texps.pro
tlmgr: package repository https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet (verified)
dvips:
texmf-dist/dvips/base/texps.pro Fixing the errorSo I installed the $ tlmgr install dvips
tlmgr: package repository https://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet (verified)
[1/2, ??:??/??:??] install: dvips.x86_64-linux [145k]
[2/2, 00:00/00:00] install: dvips [57k]
running mktexlsr ...
done running mktexlsr. Then I ran $ manim -qh scene.py TestScene
Manim Community v0.13.1
[12/14/21 19:23:11] INFO Writing "\mathbb{M}" to media/Tex/d542770d69a4bbe7.tex tex_file_writing.py:85
[12/14/21 19:23:13] INFO scene_file_writer.py:729
File ready at '/home/..../downloads/manim/media/images/scene/TestScene_Man
imCE_v0.13.1.png'
INFO Rendered TestScene scene.py:237
Played 0 animations As you can see, it worked fine. Figuring out why the Docker image worksI installed the Docker image manimcommunity/manim and compiling the scene using that worked fine out of the box. Running the following command on the Docker container confirms that the $ tlmgr search dvips
dvips - A DVI to PostScript driver
... I did a little digging and found out that dvips is installed by the My installation on the other hand is using the bare minimum scheme ( So if the Docker image was built using the Note: to see the packages provided by $ tlmgr info --list collection-basic TL;DRThe My error came up when I installed a completely bare TeX distribution (i.e. no packages other than Possible solutions
Solution 2. would be easier and would probably make the most sense, as finding any other required packages that are installed in And finally, apologiesThis is both my first time using Manim and my first time using TeX/LaTeX/TeXLive. This issue really isn't a big deal and is mostly a result of my minimalism when it comes to software so I apologize for bringing it up. |
Thank you (!!!) for this clean in-depth analysis. At this point I think both your first and second option are fine; the second one (remarking that this is a list based on Let me know if you agree and whether you are willing to adapt this PR accordingly, otherwise I'd also be fine with including this as is. |
This adds 'collection-basic' to the list of LaTeX packages on the Linux installatioon documentation page: docs/source/installation/linux.rst Several packages provided by 'collection-basic' are required for Manim to function, so the whole collection is specified rather than finding the specific packages.
7aaf3f6
to
2650d44
Compare
Ok, I changed it to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
dvips
to list of required LaTeX packages on Linux
Overview: What does this pull request change?
This adds 'dvips' to the list of LaTeX packages on the Linux
installatioon documentation page:
docs/source/installation/linux.rst
Motivation and Explanation: Why and how do your changes improve the library?
The 'dvips' package is used by the 'dvisvgm' package to convert DVI
files to SVG graphics. Without it, manim fails to render files
containing LaTeX.
Links to added or changed documentation pages
https://manimce--2371.org.readthedocs.build/en/2371/installation/linux.html#optional-dependencies
Reviewer Checklist