Skip to content

LaTeX rendering incorrectly #2912

@arredondos

Description

@arredondos

Description of bug / unexpected behavior

When using a custom LaTeX template, fractions are rendered incorrectly (no fraction line or only fraction line).
The generated .tex, .svg and .pdf files are correct. No LaTeX warnings or errors are emitted.

How to reproduce the issue

Here is a minimal working example that reproduces the problem:

Code for reproducing the problem
from manim import *

preamble = r"""
\usepackage[mathrm=sym]{unicode-math}
\setmathfont{Fira Math}
"""

template = TexTemplate(
    preamble = preamble, 
    tex_compiler = 'lualatex', 
    output_format='.pdf'
)

class MyScene(Scene):
    def construct(self):
        self.add(Tex(r"$\frac{a}{b}$", tex_template = template))

Additional media files

Images/GIFs

Here's the output, where the fraction bar is missing:

MyScene_ManimCE_v0 16 0 post0

If you remove the option output_format='.pdf' then only the fraction bar is rendered.

Logs

Terminal output Nothing noteworthy or out of the ordinary in the terminal output.

System specifications

System Details
  • Windows 10 v21H2
  • RAM: 32GB
  • Python version: 3.10.2
  • Installed modules (provide output from pip list):
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -anim (c:\python310\lib\site-packages)
Package               Version
--------------------- ------------
argon2-cffi           21.3.0
argon2-cffi-bindings  21.2.0
asttokens             2.0.5
attrs                 22.1.0
backcall              0.2.0
beautifulsoup4        4.11.1
bleach                5.0.1
blis                  0.7.7
bs4                   0.0.1
catalogue             2.0.7
certifi               2021.10.8
cffi                  1.15.1
charset-normalizer    2.0.12
click                 8.0.4
click-default-group   1.2.2
cloup                 0.13.1
colorama              0.4.4
colour                0.1.5
commonmark            0.9.1
cycler                0.11.0
cymem                 2.0.6
Cython                0.29.32
debugpy               1.6.0
decorator             5.1.1
defusedxml            0.7.1
en-core-web-sm        3.2.0
en-core-web-trf       3.2.0
entrypoints           0.4
et-xmlfile            1.1.0
executing             0.8.3
fastjsonschema        2.16.1
filelock              3.6.0
fonttools             4.32.0
gensim                4.1.2
glcontext             2.3.6
hdbscan               0.8.28
huggingface-hub       0.5.1
idna                  3.3
ipykernel             6.12.1
ipython               8.2.0
ipython-genutils      0.2.0
ipywidgets            7.7.1
isosurfaces           0.1.0
jarowinkler           1.0.2
jedi                  0.18.1
Jinja2                3.1.1
joblib                1.1.0
jsonschema            4.9.0
jupyter-client        7.2.2
jupyter-core          4.9.2
jupyterlab-pygments   0.2.2
jupyterlab-widgets    1.1.1
kaleido               0.2.1
kiwisolver            1.4.2
langcodes             3.3.0
Levenshtein           0.18.1
manim                 0.16.0.post0
ManimPango            0.4.1
mapbox-earcut         0.12.11
MarkupSafe            2.1.1
matplotlib            3.5.1
matplotlib-inline     0.1.3
mistune               0.8.4
moderngl              5.6.4
moderngl-window       2.4.1
multipledispatch      0.6.0
murmurhash            1.0.6
nbclient              0.6.6
nbconvert             6.5.0
nbformat              5.4.0
nest-asyncio          1.5.5
networkx              2.8.4
nltk                  3.7
notebook              6.4.12
numpy                 1.22.3
openpyxl              3.0.9
packaging             21.3
pandas                1.4.2
pandocfilters         1.5.0
parso                 0.8.3
pathy                 0.6.1
pickleshare           0.7.5
Pillow                9.1.0
pip                   22.2.1
plotly                5.9.0
preshed               3.0.6
prometheus-client     0.14.1
prompt-toolkit        3.0.29
psutil                5.9.0
pure-eval             0.2.2
pycairo               1.21.0
pycparser             2.21
pydantic              1.8.2
pydub                 0.25.1
pyglet                1.5.26
Pygments              2.11.2
pyparsing             3.0.8
pyrr                  0.10.3
pyrsistent            0.18.1
PySocks               1.7.1
python-dateutil       2.8.2
pytz                  2022.1
pywin32               303
pywinpty              2.0.6
PyYAML                6.0
pyzmq                 22.3.0
rapidfuzz             2.0.8
regex                 2022.3.15
requests              2.27.1
rich                  12.4.4
sacremoses            0.0.49
scikit-learn          1.0.2
scipy                 1.8.0
screeninfo            0.8
seaborn               0.11.2
Send2Trash            1.8.0
sentence-transformers 2.2.0
sentencepiece         0.1.96
setuptools            62.1.0
six                   1.16.0
skia-pathops          0.7.2
smart-open            5.2.1
soupsieve             2.3.2
spacy                 3.2.4
spacy-alignments      0.8.5
spacy-legacy          3.0.9
spacy-loggers         1.0.2
spacy-transformers    1.1.5
spylls                0.1.7
sqlitedict            2.0.0
srsly                 2.4.2
srt                   3.5.2
stack-data            0.2.0
tabulate              0.8.9
tenacity              8.0.1
terminado             0.15.0
thinc                 8.0.15
threadpoolctl         3.1.0
tinycss2              1.1.1
tokenizers            0.11.6
torch                 1.11.0
torchvision           0.12.0
tornado               6.1
tqdm                  4.64.0
traitlets             5.3.0
transformers          4.17.0
typer                 0.4.1
typing_extensions     4.1.1
Unidecode             1.3.4
urllib3               1.26.9
wasabi                0.9.1
watchdog              2.1.9
wcwidth               0.2.5
webencodings          0.5.1
widgetsnbextension    3.6.1
wrapt                 1.14.0
xlrd                  2.0.1
youtube-dl            2021.12.17
zipp                  3.8.0
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -anim (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python310\lib\site-packages)
WARNING: Ignoring invalid distribution -anim (c:\python310\lib\site-packages)
LaTeX details
  • LaTeX distribution: MikTeX
  • Installed LaTeX packages:
    Screenshot 2022-08-05 025324
FFMPEG

Output of ffmpeg -version:

ffmpeg version 5.0.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
libavutil      57. 17.100 / 57. 17.100
libavcodec     59. 18.100 / 59. 18.100
libavformat    59. 16.100 / 59. 16.100
libavdevice    59.  4.100 / 59.  4.100
libavfilter     8. 24.100 /  8. 24.100
libswscale      6.  4.100 /  6.  4.100
libswresample   4.  3.100 /  4.  3.100
libpostproc    56.  3.100 / 56.  3.100

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions