diff --git a/bin/anthology/formatter.py b/bin/anthology/formatter.py index ad78724690..f323920908 100644 --- a/bin/anthology/formatter.py +++ b/bin/anthology/formatter.py @@ -174,6 +174,9 @@ def as_text(self, element): element = deepcopy(element) for sub in element.iterfind(".//tex-math"): sub.text = self.texmath.to_unicode(sub) + sub.tail = ( + None # tail is contained within return value of texmath.to_unicode() + ) retval = etree.tostring(element, encoding="unicode", method="text") return remove_extra_whitespace(retval) diff --git a/bin/anthology/texmath.py b/bin/anthology/texmath.py index dedb347c9c..82eff7bc0e 100644 --- a/bin/anthology/texmath.py +++ b/bin/anthology/texmath.py @@ -158,7 +158,7 @@ def _parse_command(self, code, trg): def _parse_fraction(self, args, trg): if len(args) != 2: log.warn(f"Couldn't parse \\frac: got {len(args)} arguments, expected 2") - self._append_unparsed({'name': 'frac', 'args': args}, trg) + self._append_unparsed(TexCmd("frac", args=args), trg) else: # Represent numerator of fraction as superscript sx = etree.Element("sup")