From ee1ab505010fab6d170b148173243b537f57339f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20V=C3=A9ril?= Date: Sun, 9 Feb 2020 14:04:03 +0100 Subject: [PATCH] Skip bug --- tools/lib/LaTeX.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/lib/LaTeX.py b/tools/lib/LaTeX.py index 6bc2dd0d..8f3a9832 100644 --- a/tools/lib/LaTeX.py +++ b/tools/lib/LaTeX.py @@ -51,7 +51,11 @@ class newCommand(commandBase): if str(tex)==str(cmd): tex.expr=fres.expr else: - tex.replace(cmd,fres) + try: + tex.replace(cmd,fres) + except: + return False + return True def tryRun(self,tex): cmds=list(tex.find_all(self.commandName)) if len(cmds)!=0: @@ -68,7 +72,9 @@ class newCommand(commandBase): cmds=[cmd for cmd in collection if cmd.exist(tex)] if(len(cmds)>0): for cmd in cmds: - cmd.run(tex) + if not cmd.run(tex): + cmds.remove(cmd) + collection.remove(cmd) newCommand.runAll(tex,collection) class columnAlignment(Enum): Left = "l"