Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding feature for parallel text in EOATeX
  • Loading branch information
kthoden committed Apr 29, 2020
1 parent 09ddd52 commit 84b7026
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/eoatex2imxml.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# Time-stamp: <2020-04-08 19:03:16 (kthoden)>
# Time-stamp: <2020-04-29 13:30:07 (kthoden)>

"""
Converts Latex files into a customized DocBook XML file.
Expand Down Expand Up @@ -1069,6 +1069,24 @@ def process_references(xmlTree):
pass
# def process_references ends here


def process_pararefs(xmlTree):
"""Write parallel text information into paragraph tag."""

pararefs = xmlTree.xpath("//EOApararef")
for pararef in pararefs:
pararef_attributes = pararef.attrib
para_parent = pararef.xpath("./ancestor::p")[0]
# this shortcut does not seem to work
# libeoaconvert.transfer_xml_attributes(pararef, para_parent)
for attrib in pararef_attributes:
print(attrib)
para_parent.attrib[attrib] = pararef_attributes[attrib]

pararef.tag = "elementtobestripped"
# def process_pararefs ends here


##############################################################
# Preparing the Bibliography #
##############################################################
Expand Down Expand Up @@ -1294,6 +1312,7 @@ def add_bibliography_to_xml(

process_references(xmlTree)

process_pararefs(xmlTree)

xmlChapters = xmlTree.findall("//div1")

Expand Down

0 comments on commit 84b7026

Please sign in to comment.