From 71b71f2d65deefee57f96bb515a27c41b7f51f65 Mon Sep 17 00:00:00 2001 From: Xiao Young <47266984+xy-23@users.noreply.github.com> Date: Sun, 21 Jul 2019 05:13:23 +0800 Subject: [PATCH] Solution of text rendering problem (#628) Prevent unwanted space added between TextMobjects --- manimlib/mobject/svg/tex_mobject.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manimlib/mobject/svg/tex_mobject.py b/manimlib/mobject/svg/tex_mobject.py index 49dbbe02..f51f1588 100644 --- a/manimlib/mobject/svg/tex_mobject.py +++ b/manimlib/mobject/svg/tex_mobject.py @@ -157,7 +157,8 @@ class TexMobject(SingleStringTexMobject): split_list = split_string_list_to_isolate_substrings( tex_strings, *substrings_to_isolate ) - split_list = [str(x).strip() for x in split_list] + if self.arg_separator == ' ': + split_list = [str(x).strip() for x in split_list] #split_list = list(map(str.strip, split_list)) split_list = [s for s in split_list if s != ''] return split_list @@ -242,6 +243,7 @@ class TextMobject(TexMobject): CONFIG = { "template_tex_file_body": TEMPLATE_TEXT_FILE_BODY, "alignment": "\\centering", + "arg_separator": "", }