Showing:

Documentation
Parameters
Used by
References
Supersedes
Overriding
Included from
Source
Stylesheet core.xsl
Documentation

Description

TEI stylesheet dealing with elements from the core module, making LaTeX output.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Author: See AUTHORS

Id: $Id: core.xsl 9357 2011-09-21 16:15:44Z rahtz $

Copyright: 2011, TEI Consortium

Included from
Stylesheet version 2.0
Template tei:ab
Documentation

Description

Process element ab
Namespace No namespace
Match tei:ab
Mode #default
Import precedence 4
Source
<xsl:template match="tei:ab">
  <xsl:apply-templates/>
  <xsl:if test="following-sibling::tei:ab">\par</xsl:if>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:biblcite
Documentation

Description

Process element bibl
Namespace No namespace
Match tei:bibl
Mode cite
Import precedence 4
Source
<xsl:template match="tei:bibl" mode="cite">
  <xsl:apply-templates select="text()[1]"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:cit
Namespace No namespace
Match tei:cit
Mode #default
References
Parameters postQuote; preQuote
Import precedence 4
Source
<xsl:template match="tei:cit">
  <xsl:choose>
    <xsl:when test="@rend='display' or tei:q/tei:p or         tei:quote/tei:l or tei:quote/tei:p">
      <xsl:text>
\begin{quote}
</xsl:text>
      <xsl:if test="@n">
        <xsl:text>(</xsl:text>
        <xsl:value-of select="@n"/>
        <xsl:text>) </xsl:text>
      </xsl:if>
      <xsl:apply-templates select="tei:q|tei:quote"/>
      <xsl:text>\par
</xsl:text>
      <xsl:apply-templates select="tei:bibl"/>
      <xsl:text>
\end{quote}
</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$preQuote"/>
      <xsl:if test="@n">
        <xsl:text>(</xsl:text>
        <xsl:value-of select="@n"/>
        <xsl:text>) </xsl:text>
      </xsl:if>
      <xsl:apply-templates/>
      <xsl:value-of select="$postQuote"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:code
Documentation

Description

Process element code
Namespace No namespace
Match tei:code
Mode #default
Import precedence 4
Source
<xsl:template match="tei:code">\texttt{
  <xsl:apply-templates/>}</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:corr
Documentation

Description

Process <corr>
Namespace No namespace
Match tei:corr
Mode #default
References
Template i18n
Supersedes
Template tei:corr
Import precedence 4
Source
<xsl:template match="tei:corr">
  <xsl:apply-templates/>
  <xsl:choose>
    <xsl:when test="@sic">
      <xsl:text>\footnote{</xsl:text>
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">appearsintheoriginalas</xsl:with-param>
      </xsl:call-template>
      <xsl:text> \emph{</xsl:text>
      <xsl:value-of select="./@sic"/>
      <xsl:text>}.}</xsl:text>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:supplied
Documentation

Description

Process <supplied>
Namespace No namespace
Match tei:supplied
Mode #default
Import precedence 4
Source
<xsl:template match="tei:supplied">
  <xsl:text>[</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>]</xsl:text>
  <xsl:choose>
    <xsl:when test="@reason">
      <xsl:text>\footnote{</xsl:text>
      <xsl:value-of select="./@reason"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:sic
Documentation

Description

Process <sic>
Namespace No namespace
Match tei:sic
Mode #default
References
Template i18n
Supersedes
Template tei:sic
Import precedence 4
Source
<xsl:template match="tei:sic">
  <xsl:apply-templates/>
  <xsl:text> (sic)</xsl:text>
  <xsl:choose>
    <xsl:when test="@corr">
      <xsl:text>\footnote{</xsl:text>
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">shouldbereadas</xsl:with-param>
      </xsl:call-template>
      <xsl:text> \emph{</xsl:text>
      <xsl:value-of select="./@corr"/>
      <xsl:text>}.}</xsl:text>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:seg[@rend='pre']|tei:eg|tei:q[@rend='eg']
Documentation

Description

Process element eg|tei:q[@rend='eg']
Namespace No namespace
Match tei:seg[@rend='pre']|tei:eg|tei:q[@rend='eg']
Mode #default
References
Import precedence 4
Source
<xsl:template match="tei:seg[@rend='pre']|tei:eg|tei:q[@rend='eg']">
  <xsl:choose>
    <xsl:when test="ancestor::tei:cell and count(*)=1 and string-length(.)<60">
      <xsl:variable name="stuff">
        <xsl:apply-templates mode="eg"/>
      </xsl:variable>
      <xsl:text>\fbox{\ttfamily </xsl:text>
      <xsl:value-of select="tei:escapeCharsVerbatim($stuff)"/>
      <xsl:text>} </xsl:text>
    </xsl:when>
    <xsl:when test="ancestor::tei:cell and not(*)  and string-length(.)<60">
      <xsl:variable name="stuff">
        <xsl:apply-templates mode="eg"/>
      </xsl:variable>
      <xsl:text>\fbox{\ttfamily </xsl:text>
      <xsl:value-of select="tei:escapeCharsVerbatim($stuff)"/>
      <xsl:text>} </xsl:text>
    </xsl:when>
    <xsl:when test="ancestor::tei:cell or @rend='pre'">
      <xsl:text>\mbox{}\hfill\\[-10pt]\begin{Verbatim}[fontsize=\small]
</xsl:text>
      <xsl:apply-templates mode="eg"/>
      <xsl:text>
\end{Verbatim}
</xsl:text>
    </xsl:when>
    <xsl:when test="ancestor::tei:list[@type='gloss']">
      <xsl:text>\hspace{1em}\hfill\linebreak</xsl:text>
      <xsl:text>\bgroup</xsl:text>
      <xsl:call-template name="exampleFontSet"/>
      <xsl:text>\vskip 10pt\begin{shaded}
\noindent\obeylines\obeyspaces </xsl:text>
      <xsl:apply-templates mode="eg"/>
      <xsl:text>\end{shaded}
\egroup 

</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\par\bgroup</xsl:text>
      <xsl:call-template name="exampleFontSet"/>
      <xsl:text>\vskip 10pt\begin{shaded}
\obeylines\obeyspaces </xsl:text>
      <xsl:apply-templates mode="eg"/>
      <xsl:text>\end{shaded}
\par\egroup 

</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  <!--
    <xsl:choose>
      <xsl:when test="@n">
	<xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,numbers=left,label={</xsl:text>
	<xsl:value-of select="@n"/>
      <xsl:text>}]&#10;</xsl:text>
      <xsl:apply-templates mode="eg"/> 
      <xsl:text>&#10;\end{Verbatim}&#10;</xsl:text>
      </xsl:when>
      <xsl:otherwise>
	<xsl:text>&#10;\begin{Verbatim}[fontsize=\scriptsize,frame=single]&#10;</xsl:text>
	<xsl:apply-templates mode="eg"/>
	<xsl:text>&#10;\end{Verbatim}&#10;</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
-->
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:emph
Documentation

Description

Process element emph
Namespace No namespace
Match tei:emph
Mode #default
Import precedence 4
Source
<xsl:template match="tei:emph">
  <xsl:text>\textit{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:foreign
Documentation

Description

Process element foreign
Namespace No namespace
Match tei:foreign
Mode #default
Import precedence 4
Source
<xsl:template match="tei:foreign">
  <xsl:text>\textit{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:head
Documentation

Description

Process element head
Namespace No namespace
Match tei:head
Mode #default
References
Import precedence 4
Source
<xsl:template match="tei:head">
  <xsl:choose>
    <xsl:when test="parent::tei:castList"/>
    <xsl:when test="parent::tei:figure"/>
    <xsl:when test="parent::tei:list"/>
    <xsl:when test="parent::tei:lg">\subsection*{
      <xsl:apply-templates/>}</xsl:when>
    <xsl:when test="parent::tei:table"/>
    <xsl:otherwise>
      <xsl:variable name="depth">
        <xsl:apply-templates mode="depth" select=".."/>
      </xsl:variable>
      <xsl:text>
\Div</xsl:text>
      <xsl:choose>
        <xsl:when test="$depth=0">I</xsl:when>
        <xsl:when test="$depth=1">II</xsl:when>
        <xsl:when test="$depth=2">III</xsl:when>
        <xsl:when test="$depth=3">IV</xsl:when>
        <xsl:when test="$depth=4">V</xsl:when>
        <xsl:otherwise>I</xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="ancestor::tei:floatingText">Star</xsl:when>
        <xsl:when test="parent::tei:div/@rend='nonumber'">Star</xsl:when>
        <xsl:when test="ancestor::tei:back and not($numberBackHeadings='true')">Star</xsl:when>
        <xsl:when test="not($numberHeadings='true') and ancestor::tei:body">Star</xsl:when>
        <xsl:when test="ancestor::tei:front and not($numberFrontHeadings='true')">Star</xsl:when>
      </xsl:choose>
      <xsl:text>[</xsl:text>
      <xsl:value-of select="normalize-space(.)"/>
      <xsl:text>]</xsl:text>
      <xsl:text>{</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
      <xsl:if test="../@xml:id">
        <xsl:text>\label{</xsl:text>
        <xsl:value-of select="../@xml:id"/>
        <xsl:text>}</xsl:text>
      </xsl:if>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:headmakeheading
Documentation

Description

Process element head in heading mode
Namespace No namespace
Match tei:head
Mode makeheading
Import precedence 4
Source
<xsl:template match="tei:head" mode="makeheading">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:gloss
Documentation

Description

Process <gloss>
Namespace No namespace
Match tei:gloss
Mode #default
Import precedence 4
Source
<xsl:template match="tei:gloss">
  <xsl:text> \textit{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:hi
Documentation

Description

Process element hi
Namespace No namespace
Match tei:hi
Mode #default
References
Template rendering
Import precedence 4
Source
<xsl:template match="tei:hi">
  <xsl:call-template name="rendering"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template rendering
Documentation

Description

Rendering rules, turning @rend into LaTeX commands
Namespace No namespace
Used by
Template tei:hi
Import precedence 4
Source
<xsl:template name="rendering">
  <xsl:variable name="cmd">
    <xsl:choose>
      <xsl:when test="not(@rend)">\textbf</xsl:when>
      <xsl:when test="starts-with(@rend,'color')">\textcolor</xsl:when>
      <xsl:when test="@rend='bold'">\textbf</xsl:when>
      <xsl:when test="@rend='calligraphic'">\textcal</xsl:when>
      <xsl:when test="@rend='center'">\centerline</xsl:when>
      <xsl:when test="@rend='code'">\texttt</xsl:when>
      <xsl:when test="@rend='expanded'">\textsc</xsl:when>
      <xsl:when test="@rend='gothic'">\textgothic</xsl:when>
      <xsl:when test="@rend='i'">\textit</xsl:when>
      <xsl:when test="@rend='important'">\textbf</xsl:when>
      <xsl:when test="@rend='it'">\textit</xsl:when>
      <xsl:when test="@rend='ital'">\textit</xsl:when>
      <xsl:when test="@rend='italic'">\textit</xsl:when>
      <xsl:when test="@rend='italics'">\textit</xsl:when>
      <xsl:when test="@rend='large'">\textlarge</xsl:when>
      <xsl:when test="@rend='larger'">\textlarger</xsl:when>
      <xsl:when test="@rend='noindex'">\textrm</xsl:when>
      <xsl:when test="@rend='overbar'">\textoverbar</xsl:when>
      <xsl:when test="@rend='plain'">\textrm</xsl:when>
      <xsl:when test="@rend='quoted'">\textquoted</xsl:when>
      <xsl:when test="@rend='sc'">\textsc</xsl:when>
      <xsl:when test="@rend='small'">\textsmall</xsl:when>
      <xsl:when test="@rend='smallcaps'">\textsc</xsl:when>
      <xsl:when test="@rend='smaller'">\textsmaller</xsl:when>
      <xsl:when test="@rend='strike'">\sout</xsl:when>
      <xsl:when test="@rend='sub'">\textsubscript</xsl:when>
      <xsl:when test="@rend='subscript'">\textsubscript</xsl:when>
      <xsl:when test="@rend='sup'">\textsuperscript</xsl:when>
      <xsl:when test="@rend='superscript'">\textsuperscript</xsl:when>
      <xsl:when test="@rend='ul'">\uline</xsl:when>
      <xsl:when test="@rend='underline'">\underline</xsl:when>
    </xsl:choose>
  </xsl:variable>
  <xsl:value-of select="$cmd"/>
  <xsl:choose>
    <xsl:when test="starts-with(@rend,'color(')">
      <xsl:text>{</xsl:text>
      <xsl:value-of select="substring-before(substring-after(@rend,'color('),')')"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="starts-with(@rend,'color')">
      <xsl:text>{</xsl:text>
      <xsl:value-of select="substring-after(@rend,'color')"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
  </xsl:choose>
  <xsl:text>{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:hr
Documentation

Description

Process element hr
Namespace No namespace
Match tei:hr
Mode #default
Import precedence 4
Source
<xsl:template match="tei:hr">\hline</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:ident
Documentation

Description

Process element ident
Namespace No namespace
Match tei:ident
Mode #default
Import precedence 4
Source
<xsl:template match="tei:ident">
  <xsl:text>\textsf{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:item
Documentation

Description

Process element item
Namespace No namespace
Match tei:item
Mode #default
Import precedence 4
Source
<xsl:template match="tei:item">
  <xsl:text>
\item</xsl:text>
  <xsl:if test="@n">[
    <xsl:value-of select="@n"/>]</xsl:if>
  <xsl:text> </xsl:text>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:itemgloss
Documentation

Description

Process element item
Namespace No namespace
Match tei:item
Mode gloss
Import precedence 4
Source
<xsl:template match="tei:item" mode="gloss">
  <xsl:text>
\item[</xsl:text>
  <xsl:apply-templates select="preceding-sibling::tei:label[1]" mode="gloss"/>
  <xsl:text>]</xsl:text>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:label
Documentation

Description

Process element label in normal mode
Namespace No namespace
Match tei:label
Mode #default
Import precedence 4
Source
<xsl:template match="tei:label"/>
Stylesheet location ../latex2/core.xsl
Template tei:item/tei:label
Documentation

Description

Process element label in normal mode, inside an item
Namespace No namespace
Match tei:item/tei:label
Mode #default
Import precedence 4
Source
<xsl:template match="tei:item/tei:label">
  <xsl:text>\textbf{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:labelgloss
Documentation

Description

Process element label in gloss mode
Namespace No namespace
Match tei:label
Mode gloss
Import precedence 4
Source
<xsl:template match="tei:label" mode="gloss">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:lb
Documentation

Description

Process element lb
Namespace No namespace
Match tei:lb
Mode #default
Import precedence 4
Source
<xsl:template match="tei:lb">
  <xsl:text>{\hskip1pt}\newline </xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:list
Documentation

Description

Process element list
Namespace No namespace
Match tei:list
Mode #default
Import precedence 4
Source
<xsl:template match="tei:list">
  <xsl:if test="tei:head">
    <xsl:text>\leftline{\textbf{</xsl:text>
    <xsl:for-each select="tei:head">
      <xsl:apply-templates/>
    </xsl:for-each>
    <xsl:text>}} </xsl:text>
  </xsl:if>
  <xsl:if test="@xml:id">
    <xsl:text>\label{</xsl:text>
    <xsl:value-of select="@xml:id"/>
    <xsl:text>}</xsl:text>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="not(tei:item)"/>
    <xsl:when test="@type='gloss' or tei:label">
      <xsl:text>\begin{description}
</xsl:text>
      <xsl:apply-templates mode="gloss" select="tei:item"/>
      <xsl:text>
\end{description} </xsl:text>
    </xsl:when>
    <xsl:when test="@type='unordered'">
      <xsl:text>\begin{itemize}
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>
\end{itemize} </xsl:text>
    </xsl:when>
    <xsl:when test="@type='ordered'">
      <xsl:text>\begin{enumerate}
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>
\end{enumerate}</xsl:text>
    </xsl:when>
    <xsl:when test="@type='runin' or @rend='runon'">
      <xsl:apply-templates mode="runin" select="tei:item"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\begin{itemize}
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>
\end{itemize} </xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:listBibl
Documentation

Description

Process element listBibl
Namespace No namespace
Match tei:listBibl
Mode #default
References
Variables lc; uc
Import precedence 4
Source
<xsl:template match="tei:listBibl">
  <xsl:choose>
    <xsl:when test="tei:biblStruct">
      <xsl:text>\begin{bibitemlist}{1}
</xsl:text>
      <xsl:for-each select="tei:biblStruct">
        <xsl:sort select="translate(string(tei:*[1]/tei:author/tei:surname or  tei:*[1]/tei:author/tei:orgName or  tei:*[1]/tei:author/tei:name or  tei:*[1]/tei:editor/tei:surname or  tei:*[1]/tei:editor/tei:name or  tei:*[1]/tei:title),$uc,$lc)"/>
        <xsl:sort select="tei:monogr/tei:imprint/tei:date"/>
        <xsl:text>\bibitem[</xsl:text>
        <xsl:apply-templates select="." mode="xref"/>
        <xsl:text>]{</xsl:text>
        <xsl:value-of select="@xml:id"/>
        <xsl:text>}\hypertarget{</xsl:text>
        <xsl:value-of select="@xml:id"/>
        <xsl:text>}{}</xsl:text>
        <xsl:apply-templates select="."/>
      </xsl:for-each>
      <xsl:text>
\end{bibitemlist}
</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\begin{bibitemlist}{1}
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>
\end{bibitemlist}
</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:bibl
Documentation

Description

Process element tei:bibl
Namespace No namespace
Match tei:bibl
Mode #default
Import precedence 4
Source
<xsl:template match="tei:bibl">
  <xsl:choose>
    <xsl:when test="parent::tei:div|tei:listBibl">
      <xsl:text>\par \bgroup\itshape
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>\egroup\vskip6pt\par
</xsl:text>
    </xsl:when>
    <xsl:when test="parent::tei:cit">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\bgroup\itshape </xsl:text>
      <xsl:apply-templates/>
      <xsl:text>\egroup </xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:listBibl/tei:bibl
Documentation

Description

Process element listBibl/tei:bibl
Namespace No namespace
Match tei:listBibl/tei:bibl
Mode #default
Import precedence 4
Source
<xsl:template match="tei:listBibl/tei:bibl">\bibitem {
  <xsl:choose>
    <xsl:when test="@xml:id">
      <xsl:value-of select="@xml:id"/>
    </xsl:when>
    <xsl:otherwise>bibitem-
      <xsl:number level="any"/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:text>}</xsl:text>
  <xsl:choose>
    <xsl:when test="parent::tei:listBibl/@xml:lang='zh-tw' or @xml:lang='zh-tw'">
      <xsl:text>{\textChinese </xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="parent::tei:listBibl/@xml:lang='ja' or @xml:lang='ja'">
      <xsl:text>{\textJapanese </xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:apply-templates/>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:text>
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:mentioned
Documentation

Description

Process element mentioned
Namespace No namespace
Match tei:mentioned
Mode #default
Import precedence 4
Source
<xsl:template match="tei:mentioned">
  <xsl:text>\emph{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:note
Documentation

Description

Process element note
Namespace No namespace
Match tei:note
Mode #default
References
Key APP
Import precedence 4
Source
<xsl:template match="tei:note">
  <xsl:if test="@xml:id">
    <xsl:text>\hypertarget{</xsl:text>
    <xsl:value-of select="@xml:id"/>
    <xsl:text>}{}</xsl:text>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="@place='inline' or ancestor::tei:bibl or ancestor::tei:biblStruct">
      <xsl:text>(</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>) </xsl:text>
    </xsl:when>
    <xsl:when test="@place='end'">
      <xsl:text>\endnote{</xsl:text>
      <xsl:if test="@xml:id">
        <xsl:text>\label{</xsl:text>
        <xsl:value-of select="@xml:id"/>
        <xsl:text>}</xsl:text>
      </xsl:if>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="@target">
      <xsl:text>\footnotetext{</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="count(key('APP',1))>0">
      <xsl:text>\footnote{</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\footnote{</xsl:text>
      <xsl:if test="@xml:id">
        <xsl:text>\label{</xsl:text>
        <xsl:value-of select="@xml:id"/>
        <xsl:text>}</xsl:text>
      </xsl:if>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:p
Documentation

Description

Process element <p>
Namespace No namespace
Match tei:p
Mode #default
References
Key APP
Parameter numberParagraphs
Template numberParagraph
Import precedence 4
Source
<xsl:template match="tei:p">
  <xsl:choose>
    <xsl:when test="parent::tei:note and not(preceding-sibling::tei:p)">
    </xsl:when>
    <xsl:when test="count(key('APP',1))>0">
      <xsl:text>\pstart
</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\par
</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:if test="$numberParagraphs='true'">
    <xsl:call-template name="numberParagraph"/>
  </xsl:if>
  <xsl:apply-templates/>
  <xsl:if test="count(key('APP',1))>0">
    <xsl:text>
\pend
</xsl:text>
  </xsl:if>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template numberParagraph
Documentation

Description

How to number a paragraph
Namespace No namespace
Used by
Template tei:p
Import precedence 4
Source
<xsl:template name="numberParagraph">
  <xsl:text>\textit{\footnotesize[</xsl:text>
  <xsl:number/>
  <xsl:text>]} </xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:pb
Documentation

Description

Process element pb

Indication of a page break. We make it an anchor if it has an ID.

Namespace No namespace
Match tei:pb
Mode #default
References
Parameter pagebreakStyle
Template i18n
Import precedence 4
Source
<xsl:template match="tei:pb">
  <!-- string " Page " is now managed through the i18n file -->
  <xsl:choose>
    <xsl:when test="$pagebreakStyle='active'">
      <xsl:text>\clearpage </xsl:text>
    </xsl:when>
    <xsl:when test="$pagebreakStyle='visible'">
      <xsl:text>✁[</xsl:text>
      <xsl:value-of select="@unit"/>
      <xsl:text> </xsl:text>
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">page</xsl:with-param>
      </xsl:call-template>
      <xsl:text> </xsl:text>
      <xsl:value-of select="@n"/>
      <xsl:text>]✁</xsl:text>
    </xsl:when>
    <xsl:when test="$pagebreakStyle='bracketsonly'">
      <!-- To avoid trouble with the scisssors character "✁" -->
      <xsl:text>[</xsl:text>
      <xsl:value-of select="@unit"/>
      <xsl:text> </xsl:text>
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">page</xsl:with-param>
      </xsl:call-template>
      <xsl:text> </xsl:text>
      <xsl:value-of select="@n"/>
      <xsl:text>]</xsl:text>
    </xsl:when>
    <xsl:otherwise>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:if test="@xml:id">
    <xsl:text>\hypertarget{</xsl:text>
    <xsl:value-of select="@xml:id"/>
    <xsl:text>}{}</xsl:text>
  </xsl:if>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:q
Documentation

Description

Process elementq
Namespace No namespace
Match tei:q
Mode #default
References
Template makeQuote
Import precedence 4
Source
<xsl:template match="tei:q">
  <xsl:choose>
    <xsl:when test="tei:p">\begin{quote}
      <xsl:apply-templates/>\end{quote}</xsl:when>
    <xsl:when test="tei:text">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="tei:lg">\begin{quote}
      <xsl:apply-templates/>\end{quote}</xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="makeQuote"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:quote
Documentation

Description

Process element quote
Namespace No namespace
Match tei:quote
Mode #default
References
Parameters postQuote; preQuote
Import precedence 4
Source
<xsl:template match="tei:quote">
  <xsl:choose>
    <xsl:when test="parent::tei:cit">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="@rend='inline'">
      <xsl:value-of select="$preQuote"/>
      <xsl:apply-templates/>
      <xsl:value-of select="$postQuote"/>
    </xsl:when>
    <xsl:when test="@rend='display' or tei:p or tei:l or string-length(.)>150">
      <xsl:text>\begin{quote}</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>\end{quote}</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$preQuote"/>
      <xsl:apply-templates/>
      <xsl:value-of select="$postQuote"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:p[@rend='display']
Documentation

Description

Process elements p[@rend='display']
Namespace No namespace
Match tei:p[@rend='display']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:p[@rend='display']">\begin{quote}
  <xsl:apply-templates/>\end{quote}</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:q[@rend='display']
Documentation

Description

Process elements q[@rend='display']
Namespace No namespace
Match tei:q[@rend='display']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:q[@rend='display']">\begin{quote}
  <xsl:apply-templates/>\end{quote}</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:ref[@type='cite']
Documentation

Description

Process element ref[@type='cite']
Namespace No namespace
Match tei:ref[@type='cite']
Mode #default
Import precedence 4
Source
<xsl:template match="tei:ref[@type='cite']">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template text()
Documentation

Description

Process text(), escaping the LaTeX command characters.

Namespace No namespace
Match text()
Mode #default
References
Import precedence 4
Source
<xsl:template match="text()">
  <xsl:value-of select="tei:escapeChars(.)"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template @*attributetext
Documentation

Description

Process attributes in text mode, escaping the LaTeX command characters.

as with text()

Namespace No namespace
Match @*
Mode attributetext
References
Supersedes
Template @*attributetext
Overriding
Template @*attributetext
Import precedence 4
Source
<xsl:template match="@*" mode="attributetext">
  <xsl:value-of select="tei:escapeChars(.)"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template text()eg
Documentation

Description

Process elements text()
Namespace No namespace
Match text()
Mode eg
References
Overriding
Template text()eg
Import precedence 4
Source
<xsl:template match="text()" mode="eg">
  <xsl:choose>
    <xsl:when test="starts-with(.,'
')">
      <xsl:value-of select="substring-after(tei:escapeCharsVerbatim(.),'
')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="tei:escapeCharsVerbatim(.)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:soCalled
Documentation

Description

Process element soCalled
Namespace No namespace
Match tei:soCalled
Mode #default
References
Parameters postQuote; preQuote
Import precedence 4
Source
<xsl:template match="tei:soCalled">
  <xsl:value-of select="$preQuote"/>
  <xsl:apply-templates/>
  <xsl:value-of select="$postQuote"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:unclear
Documentation

Description

Process element unclear
Namespace No namespace
Match tei:unclear
Mode #default
Import precedence 4
Source
<xsl:template match="tei:unclear">
  <xsl:text>\textbf{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template tei:space
Documentation

Description

Process element space
Namespace No namespace
Match tei:space
Mode #default
Import precedence 4
Source
<xsl:template match="tei:space">
  <xsl:variable name="unit">
    <xsl:choose>
      <xsl:when test="@unit">
        <xsl:value-of select="@unit"/>
      </xsl:when>
      <xsl:otherwise>em</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="quantity">
    <xsl:choose>
      <xsl:when test="@quantity">
        <xsl:value-of select="@quantity"/>
      </xsl:when>
      <xsl:otherwise>1</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:text>\hspace{</xsl:text>
  <xsl:value-of select="$quantity"/>
  <xsl:value-of select="$unit"/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template emphasize
Namespace No namespace
Used by
Parameters
QName Namespace
class No namespace
content No namespace
Import precedence 4
Source
<xsl:template name="emphasize">
  <xsl:param name="class"/>
  <xsl:param name="content"/>
  <xsl:choose>
    <xsl:when test="$class='titlem'">
      <xsl:text>\textit{</xsl:text>
      <xsl:copy-of select="$content"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="$class='titlej'">
      <xsl:text>\textit{</xsl:text>
      <xsl:copy-of select="$content"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="$class='titlea'">
      <xsl:text></xsl:text>
      <xsl:copy-of select="$content"/>
      <xsl:text></xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:copy-of select="$content"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template Text
Namespace No namespace
References
Overriding
Template Text
Parameters
QName Namespace
words No namespace
Import precedence 4
Source
<xsl:template name="Text">
  <xsl:param name="words"/>
  <xsl:value-of select="tei:escapeChars($words)"/>
</xsl:template>
Stylesheet location ../latex2/core.xsl
Template applyRendition
Namespace No namespace
Import precedence 4
Source
<xsl:template name="applyRendition"/>
Stylesheet location ../latex2/core.xsl
Template makeSpan
Namespace No namespace
Used by
Import precedence 4
Source
<xsl:template name="makeSpan">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/core.xsl