Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #45
  • Loading branch information
kthoden committed Nov 13, 2020
1 parent 59d1f41 commit 6e3186b
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions src/stylesheets/tei2xelatex/textparts.xsl
Expand Up @@ -822,17 +822,9 @@
</xsl:template>

<xsl:template match="//tei:index">
<xsl:choose>
<xsl:when test="@indexName='keyword'">
<xsl:text>\EOAindex{</xsl:text>
</xsl:when>
<xsl:when test="@indexName='person'">
<xsl:text>\EOAindexperson{</xsl:text>
</xsl:when>
<xsl:when test="@indexName='location'">
<xsl:text>\EOAindexlocation{</xsl:text>
</xsl:when>
</xsl:choose>
<xsl:text>\index[</xsl:text>
<xsl:value-of select="@indexName"/>
<xsl:text>s]{</xsl:text>
<xsl:apply-templates select="./tei:term"/>
<xsl:if test="@spanTo">
<xsl:text>|(</xsl:text>
Expand All @@ -853,23 +845,19 @@
<xsl:template match="//tei:anchor">
<xsl:variable name="anchor" select="@xml:id"/>
<xsl:choose>
<!-- this here does not work -->
<!-- <xsl:when test="//tei:index[@spanTo='#indInd']/@indexName='keyword'"> -->
<xsl:when test="//tei:index[@spanTo='#$anchor']/@indexName='keyword'">
<xsl:text>\EOAindex{</xsl:text>
</xsl:when>
<xsl:when test="//tei:index[@spanTo='#indInd']/@indexName='person'">
<xsl:text>\EOAindexperson{</xsl:text>
</xsl:when>
<xsl:when test="//tei:index[@spanTo='#indInd']/@indexName='location'">
<xsl:text>\EOAindexlocation{</xsl:text>
<xsl:when test="//tei:index[@spanTo=concat('#', $anchor)]">
<xsl:text>\index[</xsl:text>
<xsl:value-of select="//tei:index[@spanTo=concat('#', $anchor)]/@indexName"/>
<xsl:text>s]{</xsl:text>
<xsl:value-of select="normalize-space(//tei:index[@spanTo=concat('#', $anchor)])"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>\EOAbold{</xsl:text>
<xsl:sequence select="eoa:debug(2, 'Anchor not found: ', .)"/>
<xsl:text>\textbf{</xsl:text>
<xsl:text> WARNING anchor not found: </xsl:text>
<xsl:value-of select="$anchor"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="//tei:index[@spanTo='#indInd']/tei:term"/>
<xsl:text>|)}</xsl:text>
</xsl:template>

Expand Down

0 comments on commit 6e3186b

Please sign in to comment.