From 8989483eb18309cfc5b6f9a7fb3d73bf166560a8 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Wed, 22 Jan 2020 12:09:24 +0100 Subject: [PATCH] fix & in text --- genspells.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/genspells.py b/genspells.py index 407c750..85be158 100644 --- a/genspells.py +++ b/genspells.py @@ -106,11 +106,12 @@ def generate_spell(spellname, spell): def latex_format(text): - text = re.sub(r"\*(?! )(([^*])*?)(?! )\*", "\\\\textbf{\\1}", text) + text = re.sub(r"\*(?! )(([^*])*?)(?! )\*", r"\\textbf{\1}", text) text = re.sub( r"(\s|\()([0-9]*W(?:4|6|8|10|12|20)(?:\s*\+[0-9]+)?)", r"\1\\textbf{\2}", text ) text = re.sub(r"([0-9]+)\sm", r"\1~m", text) + text = re.sub(r"&", r"\&", text) return text