Skip to content

Commit

Permalink
tei->eoatex: fix equationarray, subequations, theorems.
Browse files Browse the repository at this point in the history
  • Loading branch information
EsGeh authored and EsGeh committed Nov 22, 2019
1 parent 7e829b9 commit 60247a3
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/tei2eoatex/eoatex_textparts.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@
</xsl:template>

<xsl:template match="tei:body//tei:ab[@type='theoreminstance']">
<xsl:variable name="theorem_name" as="xs:string" select="if (not(contains(@corresp, '#'))) then (@corresp) else (substring-after(@corresp, '#'))"/>
<xsl:call-template name="begin_paragraph"/>
<xsl:text>\begin{</xsl:text>
<xsl:value-of select="substring-after(@corresp, '#')"/>
<xsl:value-of select="$theorem_name"/>
<xsl:text>}&#x000a;</xsl:text>
<xsl:apply-templates/>
<xsl:text>&#x000a;\end{</xsl:text>
<xsl:value-of select="substring-after(@corresp, '#')"/>
<xsl:value-of select="$theorem_name"/>
<xsl:text>}</xsl:text>
<xsl:text>&#x000a;</xsl:text>
</xsl:template>
Expand Down Expand Up @@ -162,6 +163,14 @@
<xsl:text>&#x000a;</xsl:text>
</xsl:template>

<xsl:template match="tei:ab[@type = ('subequations', 'equationarray')]/tei:formula[@notation = 'tex']">
<xsl:apply-templates/>
<xsl:if test="following-sibling::*">
<xsl:text>\\</xsl:text>
</xsl:if>
<xsl:text>&#x000a;</xsl:text>
</xsl:template>

<xsl:template match="tei:body//tei:p[not(ancestor::tei:note) and not(parent::tei:div[@type = 'letter']) and not(parent::tei:epigraph)]">
<xsl:call-template name="begin_paragraph"/>
<xsl:if test="
Expand Down Expand Up @@ -493,9 +502,28 @@
<xsl:apply-templates />
<xsl:text>&#x000a;</xsl:text>
</xsl:template>

<!--
<xsl:template match="tei:div[@type='sidebyside']">
<xsl:if test="preceding-sibling::*">
<xsl:text>&#x000a;</xsl:text>
</xsl:if>
<xsl:variable name="facsim_id" select="substring-after(tei:pb/@facs, '#')"/>
<xsl:variable name="facsim_path" select="//tei:teiHeader//tei:facsimile/tei:surname[ @xml:id = $facsim_id]/tei:graphic/@url"/>
<xsl:text>\EOAfacsimile[</xsl:text>
<xsl:value-of select="$facsim_id"/>
<xsl:text>]{</xsl:text>
<xsl:value-of select="$facsim_path"/>
<xsl:text>&#x000a;</xsl:text>
</xsl:template>
-->

<!-- inline elements -->

<xsl:template match="tei:ab[not(@type = ('subequations', 'equationarray'))]/tei:formula">
<!--
<xsl:template match="tei:formula">
-->
<xsl:choose>
<xsl:when test="@notation='mhchem'">
<xsl:text>\EOAchem{</xsl:text>
Expand Down

0 comments on commit 60247a3

Please sign in to comment.