3b1b / manim

Animation engine for explanatory math videos
MIT License
61.82k stars 5.75k forks source link

How to change typesetting engine to XeLatex? #2148

Open seenpeh opened 1 month ago

seenpeh commented 1 month ago

How to change typesetting engine to XeLatex?

This is the error I get. How can I fix it? I use vscode and I've tried changing the setting.json of it.

Package: xparse 2024-02-18 L3 Experimental document command parser
)
Package: fontspec 2024/02/13 v2.9a Font selection for XeLaTeX and LuaLaTeX

! Fatal Package fontspec Error: The fontspec package requires either XeTeX or
(fontspec)                      LuaTeX.
(fontspec)                      
(fontspec)                      You must change your typesetting engine to,
(fontspec)                      e.g., "xelatex" or "lualatex" instead of
(fontspec)                      "latex" or "pdflatex".

Environment

macOS:

osMrPigHead commented 1 month ago

Which version of ManimGL are you using?

If before commit d48957c3 (2022/09/13 19:42 UTC), please add these to custom_config.yml (recommended, in the directory where you run manimgl) or default_config.yml (in the directory where you installed ManimGL):

tex:
  executable: xelatex -no-pdf

(notice that if tex is already in the .yml file, you only need to put executable: xelatex -no-pdf after it) that changes the LaTeX compiler to XeLaTeX.

If after:

style:
  tex_template: ctex

that changes the LaTeX compiler to XeLaTeX and the template to ctex.

Plus, if CJK (Chinese / Japanese / Korean) characters are needed in Tex or TexText, you MUST change the compiler to XeLaTeX and template to ctex. Before commit d48957c3, you can add these to custom_config.yml: 此外,如果你需要在 TexTexText 中输入中日韩文字,就必须把 LaTeX 编译器改为 XeLaTeX 并把模板改为 ctex。d48957c3 前,你还得在 custom_config.yml 中加入以下内容:

tex:
  text_to_replace: [tex_expression]
  executable: xelatex -no-pdf
  template_file: ctex_template.tex
  intermediate_filetype: xdv