ManimCommunity / ManimCommunity/manim

weird baseline issue in multilanguage LaTeX objects

Open
#3,262 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

issue:bug
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:

![image](https://github.com/ManimCommunity/manim/assets/8582807/5eb01cc9-0b8c-4b84-be78-1819c6c68c5b)

Docker

![image](https://github.com/ManimCommunity/manim/assets/8582807/43daff35-59b6-4fb1-9298-da44b2924886)

Manim v0.17.3

![image](https://github.com/ManimCommunity/manim/assets/8582807/a5d96193-f26f-41cf-a3cb-34aed00ef4c5)

## 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.