Skip to content

TeX splitting can cause the last parts of an equation to not be displayed #2970

@kleinesfilmroellchen

Description

@kleinesfilmroellchen

Description of bug / unexpected behavior

In many varying, highly context-sensitive instances, TeX splitting causes the last part(s) of an equation to not be visible. This happens both when using splitting with {{}}, providing multiple strings, and when combining both techniques as in the example.

Expected behavior

No matter the splitting, all parts of an equation should be visible. Or at least there should be an error thrown by the TeX handling system.

How to reproduce the issue

Code for reproducing the problem
class Example(Scene):
    def construct(self):
        template = TexTemplate()
        template.add_to_preamble(r'''\usepackage[english]{babel}
        \usepackage{csquotes}\usepackage{cancel}''')
        lpc_implies_polynomial = MathTex(
            r's[t] = a_1 s[t-1] + a_2 s[t-2] + a_3 s[t-3] + \dots\\', r'{{\Downarrow}}\\', r'\text{Polynomial function}',
            tex_template=template, tex_environment='gather*').scale(0.9).shift(UP*1.5)
        lpc_implies_not_polynomial = MathTex(
            r's[t] = a_1 s[t-1] + a_2 s[t-2] + a_3 s[t-3] + \dots\\', r'\xcancel{ {{\Downarrow}} }\\', r'\text{Polynomial function}',
            tex_template=template, tex_environment='gather*').scale(0.9).shift(DOWN*1.5)
        self.add(lpc_implies_not_polynomial, lpc_implies_polynomial)

Additional media files

Images/GIFs

Example_ManimCE_v0 16 0 post0

Logs

Terminal output
Manim Community v0.16.0.post0

[09/28/22 12:04:03] INFO     Writing s[t] = a_1 s[t-1] + a_2 s[t-2] + a_3      tex_file_writing.py:87                             s[t-3] + \dots\\ \Downarrow \\ \text{Polynomial
                             function} to media\Tex\00fe9e1deec76e46.tex
[09/28/22 12:04:05] INFO     Writing s[t] = a_1 s[t-1] + a_2 s[t-2] + a_3      tex_file_writing.py:87                             s[t-3] + \dots\\ to
                             media\Tex\c6261af89b10ed5a.tex
[09/28/22 12:04:06] INFO     Writing \Downarrow to                             tex_file_writing.py:87                             media\Tex\7d700b24d332ca6c.tex
[09/28/22 12:04:08] INFO     Writing \quad\\ to media\Tex\803547458f0d8687.tex tex_file_writing.py:87[09/28/22 12:04:09] INFO     Writing \text{Polynomial function} to             tex_file_writing.py:87                             media\Tex\b83b64ccde753a44.tex
[09/28/22 12:04:10] INFO     Writing s[t] = a_1 s[t-1] + a_2 s[t-2] + a_3      tex_file_writing.py:87                             s[t-3] + \dots\\ \xcancel{  \Downarrow  }\\
                             \text{Polynomial function} to
                             media\Tex\2982feeb65364253.tex
[09/28/22 12:04:12] INFO     Writing \xcancel{} to                             tex_file_writing.py:87                             media\Tex\7b7b3a8e2f424a94.tex
[09/28/22 12:04:13] INFO     Writing {}\\ to media\Tex\9296f7c1398e4f49.tex    tex_file_writing.py:87

System specifications

LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):

pdfTeX 3.141592653-2.6-1.40.24 (TeX Live 2022)
kpathsea version 6.3.4
Copyright 2022 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.03
  • Installed LaTeX packages: (sorry this list is too long, it seems like I have pretty much all the CTAN packages)

Additional comments

This is actually my third try reporting this issue: In the first two, as soon as I isolated the equations in question, things started to work again. Now I finally have a "tame" reproducer; do note that I have seen things much whackier than this, where sometimes 90% of the equation is missing.

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