Make sure \text{...} is counted correctly in num_tex_symbols

This commit is contained in:
Grant Sanderson 2023-03-10 11:05:30 -08:00
parent b644bb51de
commit d1e2a7a157

View file

@ -16,7 +16,7 @@ def num_tex_symbols(tex: str) -> int:
# \begin{array}{cc}, etc.
pattern = "|".join(
rf"(\\{s})" + r"(\{\w+\})?(\{\w+\})?(\[\w+\])?"
for s in ["begin", "end", "phantom", "text"]
for s in ["begin", "end", "phantom"]
)
tex = re.sub(pattern, "", tex)