ManimCommunity / ManimCommunity/manim
weird baseline issue in multilanguage LaTeX objects
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Description of bug / unexpected behavior
When mixing Chinese script and Western text inside the same `Tex()` object using the `TexTemplateLibrary.ctex` or XeLaTeX directly, the baselines of the Chinese script is not adjusted to the rest of the text. Running the same code on Docker with Manim v0.16.0 results in a correct rendering.
## Expected behavior
The baseline generated by LaTeX/XeLaTeX should be preserved.
## How to reproduce the issue
Code for reproducing the problem
```py
class MyScene2(Scene):
def construct(self):
tex = Tex(r'Hallo 你好 \LaTeX', tex_template=TexTemplateLibrary.ctex).scale_to_fit_width(12)
self.add(tex)
self.wait()
```
## Additional media files
Images/GIFs
XeLaTeX output:

Docker

Manim v0.17.3

## System specifications
System Details
- OS: Windows 10
- Python version 3.9.8
- XeTeX, Version 3.141592653-2.6-0.999995 (MiKTeX 23.5)
## Additional comments
same unwanted behavior is observed on the Manimator on Discord
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided MyScene2 example using TexTemplateLibrary.ctex and XeLaTeX on the reported environment, then inspect the Tex rendering and template path. Compare the mixed Chinese and Western text output with the Docker and older Manim results; done means the generated baseline matches the expected LaTeX/XeLaTeX alignment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex, python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100