Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rule for chapters before a part
  • Loading branch information
kthoden committed Apr 12, 2019
1 parent 89c4cef commit 0fc1817
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tei2eoatex.xsl
Expand Up @@ -579,6 +579,49 @@ contexts, a double replacement is performed.
</xsl:template>

<xsl:template name="hasparts">
<xsl:for-each select="//tei:body/tei:div[@type='chapter']/tei:head">
<xsl:result-document method="text" include-content-type="no" href="{concat('texfiles/beforepart-chapter', format-number(position(), '00'), '.tex')}">
<xsl:value-of select="eoa:texcomment('A subordinate file.')" />
<!-- <xsl:apply-templates select="*[position() > 1]"/> -->
<xsl:apply-templates select="../*[position() > 1]"/>
</xsl:result-document>
<xsl:text>\EOAchapter</xsl:text>
<xsl:choose>
<xsl:when test="../@n='nonumber'">
<xsl:text>nonumber</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="./tei:choice">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="./tei:choice/tei:abbr"/>
<xsl:text>}{</xsl:text>
<xsl:apply-templates select="./tei:choice/tei:expan"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>{</xsl:text>
<xsl:apply-templates select="."/>
<xsl:text>}{</xsl:text>
<xsl:apply-templates select="."/>
</xsl:otherwise>
</xsl:choose>
<!-- <xsl:text>{</xsl:text>
<xsl:apply-templates select="."/>-->
<xsl:choose>
<xsl:when test="not(../@xml:id)">
<xsl:text>}&#x000a;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>}\EOAlabel{</xsl:text>
<xsl:value-of select="../@xml:id"/>
<xsl:text>}&#x000a;</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:text>\input{</xsl:text>
<xsl:value-of select="concat('texfiles/beforepart-chapter', format-number(position(), '00'), '.tex')"/>
<xsl:text>}&#x000a;&#x000a;</xsl:text>
</xsl:for-each>

<xsl:for-each select="//tei:div[@type='part']/tei:head">
<xsl:variable name="partposition" select="position()"/>
<xsl:text>\EOApart{</xsl:text>
Expand Down

0 comments on commit 0fc1817

Please sign in to comment.