question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reconsidering TEX_USE_CTEX / using XeLaTeX

See original GitHub issue

I worked on manim back in 2018. I added the function for using CTeX (XeLaTeX package for Chinese) and XeLaTeX instead of LaTeX using the flag TEX_USE_CTEX in constants.py (#315).

I have stopped working on manim since 2019, but over the months there are apparently more and more people who want to use LaTeX rendering in non-English languages, and even on very old issues I still occasionally see people asking how to do that… Looking back at my change I really should have decoupled using CTeX (TeX template) from XeLaTeX (rendering tool). This has caused a lot of confusions and made weird hacks/fixes necessary for only using XeLaTeX, especially for a language that is not Chinese or English, with the most recent #858 and #840. It really should have been a flag TEX_USE_XELATEX and another flag TEMPLATE_TEX_NAME, and the flag TEX_USE_CTEX is such that when it is True, TEX_USE_XELATEX is True and TEMPLATE_TEX_NAME is "ctex_template.tex"; otherwise TEX_USE_XELATEX is False and TEMPLATE_TEX_NAME is "tex_template.tex". Then set TEMPLATE_TEX_FILE to os.path.join(os.path.dirname(os.path.realpath(__file__)), TEMPLATE_TEX_NAME). Corresponding logic: constants.py lines 74–79.

It might be even better to set it dynamically using a function or as a parameter of TexMobject(), (see issues like #891). I looked at the source code and this is definitely possible. The options I can think of are

  1. Use the current TEX_USE_CTEX
  2. Add flags TEX_USE_XELATEX and TEMPLATE_TEX_NAME, and rework TEX_USE_CTEX
  3. Add parameters for TexMobject() like use_xelatex=False and tex_template="tex_template.tex"
  4. Use the flags of 2. as a default, and make it possible to change the default using 3.

Not really sure if this is the right place to raise this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hanwenzhucommented, Mar 19, 2020

#723 is also a pretty good idea and there is a similar pr #745 although it doesn’t decouple CTeX from XeLaTeX

0reactions
hanwenzhucommented, Aug 9, 2021

Closing as issue is fixed downstream at ManimCommunity. Anyone interested in multilingual support is recommended to use the community version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using XeLaTeX instead of pdfLaTeX - LaTeX Stack Exchange
1 Answer 1 · Your input file must be UTF-8 encoded · You must not load the inputenc package. · You use the...
Read more >
XeLaTeX - Overleaf, Online LaTeX Editor
An online LaTeX editor that's easy to use. No installation, real-time collaboration, version control, hundreds of LaTeX templates, and more.
Read more >
Can the XeLaTeX builder be used with Sphinx? - Stack Overflow
I'm using raw latex entries myself to remove the section numbers from part of my documentation ( \setcounter{secnumdepth}{-1} in a similar "raw" entry)....
Read more >
Getting started with XeLaTeX - Rob J Hyndman
XeLaTeX is essentially a replacement for pdfLaTeX. It was primarily developed to enable better font handling, especially non-Roman scripts. If ...
Read more >
XeTeX - Wikipedia
XeTeX is a TeX typesetting engine using Unicode and supporting modern font technologies such as OpenType, Graphite and Apple Advanced Typography (AAT).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found