internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: acl-org/acl-anthology

Issue:
Ingest CCL 2021
https://www.dropbox.com/s/qji3pa7mt3p1vv3/ccl2021_data.tgz?dl=0


Discussion:

Resolving patch:
diff --git a/bin/author_names_to_variants.py b/bin/author_names_to_variants.py
old mode 100644
new mode 100755
--- a/bin/author_names_to_variants.py
+++ b/bin/author_names_to_variants.py
@@ -1,3 +1,10 @@
+#!/usr/bin/env python3
+'''
+Usage example: python bin/author_names_to_variants.py data/xml/2021.ccl.xml data/xml/2021.ccl.xml
+
+Input: xml file generated by ingest.py
+Output: updated xml file including name variant
+'''
 import lxml.etree as etree
 import sys
 import unicodedata
diff --git a/bin/ingest.py b/bin/ingest.py
--- a/bin/ingest.py
+++ b/bin/ingest.py
@@ -413,6 +413,14 @@ def disambiguate_name(node, anth_id):
                 for author_or_editor in chain(
                     paper_node.findall("./author"), paper_node.findall("./editor")
                 ):
+                    disamb_name, name_choice = disambiguate_name(
+                        author_or_editor, paper_id_full
+                    )
+                    if name_choice != -1:
+                        author_or_editor.attrib["id"] = disamb_name
+                    person = PersonName.from_element(author_or_editor)
+                    for name_part in author_or_editor:
+                        name_part.text = correct_caps(name_part.text)
                     meta_node.append(author_or_editor)
                     author_or_editor.tag = "editor"
 


Test patch:
Repository: acl-org/acl-anthology

Issue:
Correction to Anthology ID 2021.naacl-main.477
## Revision or erratum

- [X] I have attached the revised PDF or erratum to this issue
- [X] I have written a brief description of the changes below

**Description of changes**

From Bushra Sabir:  I want to bring to your notice that my paper ID: 1271, "ReinforceBug: A Framework to Generate Adversarial Textual Examples" got accepted and was orally presented in NAACL-2021. Initially, the paper was missing from sessions as well and at my request, it was added. This piece of work is an important work in my PHD, however, due to its absence in proceedings, it's hard for me to claim it. I request you to please add in the proceedings so that it is easy for me to link it to my ORCID profile.

From email discussion amongst the NAACL 2021 committees: This paper was accidentally not included in the NAACL 2021 proceedings because it was accidentally not included in the schedule from which ACLPUB generates the proceedings. We decided that it would be too risky at this point to regenerate the entire proceedings, so instead, we would like to just add it to the ACL Anthology directly. I have guessed a new Anthology ID for it (I believe this is one beyond the largest number assigned to a NAACL main paper) but please feel free to adjust as necessary.

The official author list from START is:
* Bushra Sabir
* Muhammad Ali Babar
* Raj Gaire

Here are the paper, data, and code from the START final submission:
* [1271_Paper.pdf](https://github.com/acl-org/acl-anthology/files/7781672/1271_Paper.pdf)
* [1271_OptionalSupplementaryData.xlsx](https://github.com/acl-org/acl-anthology/files/7781674/1271_OptionalSupplementaryData.xlsx)
* [1271_OptionalSupplementaryCode.zip](https://github.com/acl-org/acl-anthology/files/7781676/1271_OptionalSupplementaryCode.zip)



Discussion:

Resolving patch:
diff --git a/bin/add_attachment.py b/bin/add_attachment.py
old mode 100644
new mode 100755


Test patch:
Repository: acl-org/acl-anthology

Issue:
Correction to Anthology ID 2021.paclic-1
In PACLIC 2021 proceedings (https://aclanthology.org/volumes/2021.paclic-1/), edit the indexed name for "Joseph Marvin R. Imperial" of paper 26 (https://aclanthology.org/2021.paclic-1.26/) to "Joseph Marvin Imperial" (no R.) to combine previously indexed papers with one author below:

https://aclanthology.org/people/j/joseph-marvin-imperial/







Discussion:

Resolving patch:
diff --git a/bin/retract_paper.py b/bin/retract_paper.py
--- a/bin/retract_paper.py
+++ b/bin/retract_paper.py
@@ -1,4 +1,4 @@
-#! /usr/bin/env python3
+#!/usr/bin/env python3
 # -*- coding: utf-8 -*-
 #
 # Copyright 2020 Matt Post <post@cs.jhu.edu>
@@ -46,20 +46,17 @@
 
 template = Template(
     r"""\documentclass{article}
-\usepackage[printwatermark]{xwatermark}
+\usepackage[text=RETRACTED,scale=3,color=red]{draftwatermark}
 \usepackage{xcolor}
 \usepackage{graphicx}
 \usepackage{pdfpages}
 \usepackage{hyperref}
 \hypersetup{plainpages=false,
-            pdfpagemode=none,
+            pdfpagemode=UseNone,
             colorlinks=true,
             unicode=true
 }
 
-% "allpages" didn't work
-\newwatermark[pages=1-1000,color=red!80,angle=45,scale=3,xpos=-6,ypos=0]{RETRACTED}
-
 % set A4
 \setlength{\paperwidth}{21cm}
 \setlength{\paperheight}{29.7cm}
@@ -101,11 +98,11 @@ def add_watermark(anth_id, workdir="."):
     command = f"pdflatex {tex_file}"
     try:
         subprocess.call(
-            command, shell=True, cwd=workdir, stdout=subprocess.DEVNULL, timeout=60
+            command, shell=True, cwd=workdir, stdout=subprocess.DEVNULL, timeout=30
         )
-    except TimeoutExpired:
+    except subprocess.TimeoutExpired:
         print(
-            "pdflatex didn't finish within 60 seconds. Do you have the CTAN watermark package installed?",
+            "pdflatex didn't finish within 30 seconds. Do you have the CTAN watermark package installed?",
             file=sys.stderr,
         )
         sys.exit(1)


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion request (2022-05-31)
Dear editors of ACL Anthology, as I requested before (to Matt Post), I would like to upload the papers of the conference UDFEST-BR 2022. Here goes the required information:
- venue identifier: udfestbr (already arranged with Matt)
- volume title: Proceedings of the Universal Dependencies Brazilian Festival
- website: https://sites.google.com/icmc.usp.br/udfest-br/
- publication date: if possible, until the end of this month (May)

Best regards,
Thiago A. S. Pardo
taspardo@icmc.usp.br



Discussion:
Hi @ud-portugues, sounds good. Can you provide the proceedings tarball?
Hi, Matt. I had sent it in another e-mail. Here goes the link to it:

https://www.dropbox.com/s/kpee0ehkh7juldk/udfestbr_data.tgz?dl=0

Best regards,
Thiago A. S. Pardo


Resolving patch:
diff --git a/bin/anthology/papers.py b/bin/anthology/papers.py
--- a/bin/anthology/papers.py
+++ b/bin/anthology/papers.py
@@ -15,7 +15,7 @@
 # limitations under the License.
 
 from functools import cached_property
-import iso639
+import langcodes
 import logging as log
 
 from .utils import (
@@ -293,7 +293,7 @@ def isbn(self):
 
     @property
     def langcode(self):
-        """Returns the ISO-639 language code, if present"""
+        """Returns the BCP47 language code, if present"""
         return self.attrib.get("language", None)
 
     @property
@@ -301,7 +301,7 @@ def language(self):
         """Returns the language name, if present"""
         lang = None
         if self.langcode:
-            lang = iso639.languages.get(part3=self.langcode).name
+            lang = langcodes.Language.get(self.langcode).display_name()
         return lang
 
     def get(self, name, default=None):


Test patch:
Repository: acl-org/acl-anthology

Issue:
Correction to Anthology ID 2022.naacl-main.0
Missing PDF


Discussion:

Resolving patch:
diff --git a/bin/ingest_aclpub2.py b/bin/ingest_aclpub2.py
--- a/bin/ingest_aclpub2.py
+++ b/bin/ingest_aclpub2.py
@@ -363,10 +363,20 @@ def copy_pdf_and_attachment(
     if not dry_run:
         maybe_copy(proceedings_pdf_src_path, proceedings_pdf_dest_path)
 
+    # copy frontmatter
+    frontmatter_src_path = os.path.join(pdfs_src_dir, '0.pdf')
+    frontmatter_dest_path = (
+        os.path.join(pdfs_dest_dir, f"{collection_id}-{volume_name}") + '.0.pdf'
+    )
+    if dry_run:
+        print(f'would\'ve moved {frontmatter_src_path} to {frontmatter_dest_path}')
+    if not dry_run:
+        maybe_copy(frontmatter_src_path, frontmatter_dest_path)
+
     paper_id_full = f'{collection_id}-{volume_name}.0'
     volume[0] = {
         'anthology_id': paper_id_full,
-        'pdf': proceedings_pdf_dest_path,
+        'pdf': frontmatter_dest_path,
         'attachments': [],
     }
 


Test patch:
Repository: acl-org/acl-anthology

Issue:
Correction to Anthology ID 2022.clpsych-1.9
Metadata correction:
author’s name is listed as Aren, but should be Areán (as shown in the pdf)


Discussion:

Resolving patch:
diff --git a/bin/add_revision.py b/bin/add_revision.py
--- a/bin/add_revision.py
+++ b/bin/add_revision.py
@@ -137,9 +137,10 @@ def maybe_copy(file_from, file_to):
 
         if not dry_run:
             # Update the URL hash on the <url> tag
-            url = paper.find("./url")
-            if url is not None:
-                url.attrib["hash"] = checksum
+            if change_type != "erratum":
+                url = paper.find("./url")
+                if url is not None:
+                    url.attrib["hash"] = checksum
 
             if change_type == "revision" and revno == 2:
                 if paper.find("./url") is not None:


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion request: Generation challenges at INLG 2022
This is to complete the ingestions of all papers from INLG; the Generation Challenges papers still needed to be uploaded. See #1897 for the other papers. 

Here are the papers and metadata from the INLG generation challenges, as generated using ACLPUB2: https://drive.google.com/file/d/1518aAVuvtbvHgw_6FREzJl0kip_lkqNg/view?usp=share_link

I think this matches the Anthology format, but I'm not sure as I added everything manually. (Export didn't work.) Could you check whether everything is OK to ingest in the Anthology? Many thanks!


Discussion:

Resolving patch:
diff --git a/bin/volumes_from_diff.py b/bin/volumes_from_diff.py
--- a/bin/volumes_from_diff.py
+++ b/bin/volumes_from_diff.py
@@ -27,7 +27,7 @@
         continue
     root = tree.getroot()
     collection_id = root.attrib["id"]
-    for volume in root:
+    for volume in root.findall("./volume"):
         volume_name = volume.attrib["id"]
         volume_id = f"{collection_id}-{volume_name}"
         volumes.append(f"[{volume_id}]({args.url_root}/{volume_id})")


Test patch:
Repository: acl-org/acl-anthology

Issue:
Missing EMNLP 2022 items
Open issues on missing items, awaiting delivery from EMNLP organizers.

- [x] ~Full-volume PDF for main~ (we're skipping this)
- [x] Frontmatter (missing for both findings and main): https://aclanthology.org/2022.emnlp-main.0
- [x] Full-volume PDF for Findings (currently corrupted): https://aclanthology.org/2022.findings-emnlp
- [x] Attachments for main and Findings
- [x] Complete industry volume
- [x] Complete system demonstrations volume
- [x] Author affiliation metadata
- [x] DOIs (#2420)


Discussion:
Fix: link nlpcss to emnlp 22 and check all colocated workshops.

Resolving patch:
diff --git a/bin/ingest_aclpub2.py b/bin/ingest_aclpub2.py
--- a/bin/ingest_aclpub2.py
+++ b/bin/ingest_aclpub2.py
@@ -186,8 +186,8 @@ def add_paper_nums_in_paper_yaml(
             elif paper_id == '2051':
                 num_of_pages = 14
             else:
-                pdf_reader = PyPDF2.PdfFileReader(pdf)
-                num_of_pages = pdf_reader.numPages
+                pdf_reader = PyPDF2.PdfReader(pdf)
+                num_of_pages = len(pdf_reader.pages)
             start = end + 1
             end = start + num_of_pages - 1
             paper['pages'] = f'{start}-{end}'


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion request: NEJLT vol 7 & 8
This is a new (to the anthology) venue.

* **Venue name:** Northern European Journal of Language Technology (NEJLT)
* **Website:** [nejlt.org](https://www.nejlt.org/)
* Papers at https://doi.org/10.3384/nejlt.2000-1533.8.1 and https://doi.org/10.3384/nejlt.2000-1533.7.1

I propose:
* volume identifier `nejlt`
* volume titles in the format _Northern European Journal of Language Technology, Volume n_

We're ready to send over two volumes, for 2021 and 2022. Iff and when this is OK with you, I'm happy to go assemble ACLPUB format volumes and send them.


Discussion:
Looks good to me. I suggest starting with one volume to get the details right, then we can move to the next. @xinru1414 can process when you're ready.
Alright, here's a first pass :)

> [nejlt_2021_data.tgz](https://github.com/acl-org/acl-anthology/files/10407895/nejlt_2021_data.tgz)


It's best effort - I got this, sorry if I've found the wrong version somehow (followed https://acl-org.github.io/ACLPUB/anthology.html).
```
leod@mac622226 nejlt-pub % python3 ACLPUB/bin/sanity_check.py data
This script doesn't do anything yet. So you're all good!
```

@xinru1414 Is there anything more I can do to help on this?
@leondz I saw that there are only two papers. I'm wondering if there's a full proceedings pdf file and a front matter pdf file?

Example full proceedings pdf file: https://aclanthology.org/2021.alvr-1.pdf
Example front matter pdf file: https://aclanthology.org/2021.alvr-1.0.pdf

@mjpost Correct me if I'm wrong, i think these two files are required. 
@xinru1414 This was a short issue, so no front matter or full proceedings was compiled. I've seen prior items on the anthology without them, but maybe that's no longer the policy - happy to build these if requested.

Resolving patch:
diff --git a/bin/anthology/data.py b/bin/anthology/data.py
--- a/bin/anthology/data.py
+++ b/bin/anthology/data.py
@@ -146,6 +146,10 @@ def get_journal_info(top_level_id, volume_title) -> Tuple[str, str, str]:
         journal_title = "Traitement Automatique des Langues"
         volume_no, issue_no = match_volume_and_issue(volume_title)
 
+    elif top_level_id == "nejlt":
+        journal_title = "Northern European Journal of Language Technology"
+        volume_no, _ = match_volume_and_issue(volume_title)
+
     elif top_level_id[0] == "J":
         # <booktitle>Computational Linguistics, Volume 26, Number 1, March 2000</booktitle>
         year = int(top_level_id[1:3])


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion request: PACLIC 2022
[https://drive.google.com/drive/folders/1k1Ea_fFNxo_aMBonjSfr0G9k7cOCnCDF?usp=share_link](https://l.facebook.com/l.php?u=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1k1Ea_fFNxo_aMBonjSfr0G9k7cOCnCDF%3Fusp%3Dshare_link%26fbclid%3DIwAR0zaKXkPHTHU8vOYwhUuxip4Rj8x3Y_sM_yxbZL-xHi5K6O_LkZXzYmMrk&h=AT3Y8jQ-dTIf9-vrpcQILm_H9clAuhZ8cdXX6HF2Dw8SOfQK9p7WW8KYSQlFZXhDLQ6_oZfI6fI7wMCWVqMcvuXoD9h0h17zU3p_n-omUsDuMS_lymPlNeteP8l9DMByeTEmNZK-W7GLmW2wSnx1CUw_)



Discussion:

Resolving patch:
diff --git a/bin/ingest.py b/bin/ingest.py
--- a/bin/ingest.py
+++ b/bin/ingest.py
@@ -131,7 +131,7 @@ def bib2xml(bibfilename, anthology_id):
     bibdata = read_bibtex(bibfilename)
     if len(bibdata.entries) != 1:
         log(f"more than one entry in {bibfilename}")
-    bibkey, bibentry = bibdata.entries.items()[0]
+    bibkey, bibentry = list(bibdata.entries.items())[0]
     if len(bibentry.fields) == 0:
         log(f"parsing bib of paper {paper_no} failed")
         sys.exit(1)


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion Request: {NoDaLiDa 2023 Workshop RESOURCEFUL}
### General information about this request

- [X] I confirm that I have read the [Information for Submitters](https://aclanthology.org/info/contrib/).
- [X] I am submitting a request for a **new venue** that does not exist in the ACL Anthology yet.

### Venue Identifier

~nodalida~
resourceful

### Volume Title

Proceedings of the Second Workshop on Resources and Representations for Under-Resourced Languages and Domains (RESOURCEFUL-2023)

### Venue Name (only if you are submitting a new venue)

~Nordic Conference of Computational Linguistics (NoDaLiDa)~
Workshop on Resources and Representations for Under-Resourced Languages and Domains

### Venue Website (only if you are submitting a new venue)

~https://www.nodalida2023.fo~
https://resourceful-workshop.github.io/resourceful-2023/

### Date of Publication

2023-05-19

### Supporting Information

This workshop is a part of the Nordic Conference of Computational Linguistics (NoDaLiDa).


Discussion:
@sdobnik Please submit ingestion material following instructions here https://aclanthology.org/info/contrib/ 
We have used OpenReview for the conference and, accordingly, used ACLPUB2 to generate the proceedings. You can download the 'output' folder here:

https://gunet-my.sharepoint.com/:u:/g/personal/nikolai_ilinykh_gu_se/EY3uwPbRugBIp6tm8Otws4QB8gEFgPRvpo871318og-3BQ?e=TGgcf2

I have tried to verify the ingestion by running ``bin/ingest_aclpub2.py``, but it kept giving the following message to me:

> event name should start with Workshop or The Workshop, instead it started with The Workshop

This does not look like an error to me - the event name already starts with 'The Workshop'.

Let me know if you need more information or have any questions.

Resolving patch:
diff --git a/bin/ingest_aclpub2.py b/bin/ingest_aclpub2.py
--- a/bin/ingest_aclpub2.py
+++ b/bin/ingest_aclpub2.py
@@ -347,7 +347,7 @@ def process_procedding(
         event_name = meta['event_name']
         assert (
             re.match(r'(.)* [Ww]orkshop', event_name) is None
-        ), f"event name should start with Workshop or The Workshop, instead it started with {re.match(r'(.)* [Ww]orkshop', event_name)[0]}"
+        ), f"event name should start with Workshop, instead it started with {re.match(r'(.)* [Ww]orkshop', event_name)[0]}"
         print(f"Creating new venue '{venue_abbrev}' ({event_name})")
         venue_index.add_venue(anthology_datadir, venue_abbrev, meta['event_name'])
 


Test patch:
Repository: acl-org/acl-anthology

Issue:
Inflated counts on author page
### Confirm that this is a bug report

- [X] I want to report an issue that does _not_ concern paper or author metadata.
- [X] I have searched for similar existing issues first.

### Problem Description

I notice that on my [author page](https://aclanthology.org/people/n/nathan-schneider/) there are paper counts by co-author and venue. These appear to include all papers in workshops that I chaired. Might this be an unintended side effect of #2798?

<img width="275" alt="image" src="https://github.com/acl-org/acl-anthology/assets/985263/1d5f3d91-78a0-4601-98ba-3cd33f1e3df6">



Discussion:

Resolving patch:
diff --git a/bin/anthology/index.py b/bin/anthology/index.py
--- a/bin/anthology/index.py
+++ b/bin/anthology/index.py
@@ -309,7 +309,7 @@ def register(self, paper, dummy=False):
                 if not self._fast_load:
                     self._id_to_used[id_].add(name)
 
-                if not dummy:
+                if not dummy and (role == "author" or paper.is_volume):
                     # Register paper
                     self.id_to_papers[id_][role].append(paper.full_id)
                     if not self._fast_load:
diff --git a/bin/anthology/papers.py b/bin/anthology/papers.py
--- a/bin/anthology/papers.py
+++ b/bin/anthology/papers.py
@@ -503,6 +503,8 @@ def items(self):
         return self.attrib.items()
 
     def iter_people(self):
-        for role in ("author", "editor"):
-            for name, id_ in self.get(role, []):
-                yield (name, id_, role)
+        for name, id_ in self.get("author", []):
+            yield (name, id_, "author")
+        if self.is_volume:
+            for name, id_ in self.get("editor", []):
+                yield (name, id_, "editor")


Test patch:
Repository: acl-org/acl-anthology

Issue:
Ingestion Request: CG-MTA 2023 (NoDaLiDa 2023 workshop)
### General information about this request

- [X] I confirm that I have read the [Information for Submitters](https://aclanthology.org/info/contrib/).
- [X] I am submitting a request for a **new venue** that does not exist in the ACL Anthology yet.

### Venue Identifier

cg-mta

### Volume Title

Proceedings of the NoDaLiDa 2023 Workshop on Constraint Grammar - Methods, Tools and Applications

### Venue Name (only if you are submitting a new venue)

Constraint Grammar - Methods, Tools, and Applications

### Venue Website (only if you are submitting a new venue)

https://edu.visl.dk/nodalida2023.html

### Date of Publication

_No response_

### Supporting Information

This workshop was a part of the Nordic Conference of Computational Linguistics (NoDaLiDa) 2023.


Discussion:
@alumae Could you submit ingestion material? 
We are still waiting for ISBN from ACL. I wrote an e-mail to ACL Business Manager (acl.rachford@gmail.com), that's the correct process right?

The issue with ISBN was resolved.

Since we were using OpenReview for the conference, I used ACLPUB2 to compile the proceedings. The compressed 'output' directory in ACLPUB2 format is uploaded here: https://drive.google.com/file/d/1a-ZD119FL9O0czyXwGvk7NvJGkaqGOej/view?usp=sharing

I have verified that the output directory can be ingested by the bin/ingest_aclpub2.py tool.


@anthology-assist Gentle reminder that the material is ready for ingestion

Resolving patch:
diff --git a/bin/ingest_aclpub2.py b/bin/ingest_aclpub2.py
--- a/bin/ingest_aclpub2.py
+++ b/bin/ingest_aclpub2.py
@@ -447,7 +447,7 @@ def process_proceeding(
         if re.match(r'(.)* [Ww]orkshop', event_name) is None:
             print(
                 "* Warning: event name should start with Workshop, instead it started with",
-                re.match(r'(.)* [Ww]orkshop', event_name)[0],
+                re.match(r'(.)* [Ww]orkshop', event_name),
                 file=sys.stderr,
             )
         print(f"Creating new venue '{venue_abbrev}' ({event_name})")


Test patch:
Repository: acl-org/acl-anthology

Issue:
Paper Metadata: 2023.findings-emnlp.1054
### Confirm that this is a metadata correction

- [X] I want to file corrections to make the metadata match the PDF file hosted on the ACL Anthology.

### Anthology ID

2023.findings-emnlp.1054

### Type of Paper Metadata Correction

- [X] Paper Title
- [ ] Paper Abstract
- [ ] Author Name(s)

### Correction to Paper Title

Please change the paper title appeared in Cite (ACL) and Cite (Informal) to "Measuring Pointwise 𝒱-Usable Information In-Context-ly"

### Correction to Paper Abstract

_No response_

### Correction to Author Name(s)

_No response_


Discussion:
@boblus could you point out specifically what's wrong? https://aclanthology.org/2023.findings-emnlp.1054/
The title appears in Cite (ACL) and Cite (Informal) is “Measuring Pointwise 𝒱-Usable Information In-Context-ly-Usable Information In-Context-ly,” which is incorrect.
@anthology-assist This looks like a bug in the code, not a metadata problem. I'll check.

Resolving patch:
diff --git a/bin/anthology/texmath.py b/bin/anthology/texmath.py
--- a/bin/anthology/texmath.py
+++ b/bin/anthology/texmath.py
@@ -230,4 +230,4 @@ def to_unicode(self, element):
         HTML tags afterwards.
         """
         element = self.to_html(element)
-        return etree.tostring(element, encoding="unicode", method="text")
+        return etree.tostring(element, encoding="unicode", method="text", with_tail=False)


Test patch:
diff --git a/tests/test_tex_math.py b/tests/test_tex_math.py
--- a/tests/test_tex_math.py
+++ b/tests/test_tex_math.py
@@ -263,6 +263,8 @@ def test_unicode(inp, out):
     element = etree.fromstring(f"<span>{inp}</span>")
     math_element = element.find(".//tex-math")
     actual_out = texmath.to_unicode(math_element)
+    if math_element.tail:
+        actual_out += math_element.tail
     assert actual_out == out