Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Supersedes
Overriding
Imported modules
Imported from
Source
Stylesheet tei.xsl
Documentation

Description

TEI stylesheet for making LaTeX output.

This software is dual-licensed: 1. Distributed under a Creative Commons Attribution-ShareAlike 3.0 Unported License http://creativecommons.org/licenses/by-sa/3.0/ 2. http://www.opensource.org/licenses/BSD-2-Clause All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

Author: See AUTHORS

Id: $Id: tei.xsl 10972 2012-10-21 16:38:49Z rahtz $

Copyright: 2011, TEI Consortium

Imported modules
Imported from
Stylesheet version 2.0
Template processing-instruction()[name(.)='tex']
Documentation

Description

Process elements processing-instruction()[name(.)='tex']
Namespace No namespace
Match processing-instruction()[name(.)='tex']
Mode #default
Import precedence 24
Source
<xsl:template match="processing-instruction()[name(.)='tex']">
  <xsl:value-of select="."/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template verbatim-lineBreak
Namespace No namespace
Supersedes
Overriding
Parameters
QName Namespace
id No namespace
Import precedence 24
Source
<xsl:template name="verbatim-lineBreak">
  <xsl:param name="id"/>
  <xsl:text>\mbox{}\newline 
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template verbatim-createElement
Namespace No namespace
Used by
Supersedes
Parameters
QName Namespace
name No namespace
special No namespace
Import precedence 24
Source
<xsl:template name="verbatim-createElement">
  <xsl:param name="name"/>
  <xsl:param name="special"/>
  <xsl:text>\textbf{</xsl:text>
  <xsl:value-of select="$name"/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template verbatim-newLine
Namespace No namespace
Used by
Template
Supersedes
Template
Import precedence 24
Source
<xsl:template name="verbatim-newLine"/>
Stylesheet location ../latex2/tei.xsl
Template verbatim-createAttribute
Namespace No namespace
Used by
Template
Supersedes
Parameters
QName Namespace
name No namespace
Import precedence 24
Source
<xsl:template name="verbatim-createAttribute">
  <xsl:param name="name"/>
  <xsl:value-of select="$name"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template verbatim-Text
Namespace No namespace
Used by
References
Supersedes
Template
Parameters
QName Namespace
words No namespace
Import precedence 24
Source
<xsl:template name="verbatim-Text">
  <xsl:param name="words"/>
  <xsl:choose>
    <xsl:when test="parent::*/@xml:lang='zh-TW'">
      <xsl:text>{\textChinese </xsl:text>
      <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="parent::*/@xml:lang='ja'">
      <xsl:text>{\textJapanese </xsl:text>
      <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="parent::*/@xml:lang='kr'">
      <xsl:text>{\textKorean </xsl:text>
      <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="tei:escapeCharsVerbatim($words)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template emphasize
Namespace No namespace
Used by
Parameters
QName Namespace
class No namespace
content No namespace
Import precedence 24
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/tei.xsl
Template Text
Namespace No namespace
References
Overriding
Template
Parameters
QName Namespace
words No namespace
Import precedence 24
Source
<xsl:template name="Text">
  <xsl:param name="words"/>
  <xsl:value-of select="tei:escapeChars($words)"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template applyRendition
Namespace No namespace
Import precedence 24
Source
<xsl:template name="applyRendition"/>
Stylesheet location ../latex2/tei.xsl
Template makeSpan
Namespace No namespace
Used by
Import precedence 24
Source
<xsl:template name="makeSpan">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template text()
Documentation

Description

Process text(), escaping the LaTeX command characters.

Namespace No namespace
Match text()
Mode #default
References
Import precedence 24
Source
<xsl:template match="text()">
  <xsl:value-of select="tei:escapeChars(.)"/>
</xsl:template>
Stylesheet location ../latex2/tei.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
Overriding
Template
Import precedence 24
Source
<xsl:template match="@*" mode="attributetext">
  <xsl:value-of select="tei:escapeChars(.)"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template text()eg
Documentation

Description

Process text (in example mode)
Namespace No namespace
Match text()
Mode eg
References
Overriding
Template
Import precedence 24
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/tei.xsl
Template processBlock
Namespace No namespace
Parameters
QName Namespace
style No namespace
Import precedence 24
Source
<xsl:template name="processBlock">
  <xsl:param name="style"/>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template processInline
Namespace No namespace
Parameters
QName Namespace
after No namespace
before No namespace
style No namespace
Import precedence 24
Source
<xsl:template name="processInline">
  <xsl:param name="before"/>
  <xsl:param name="after"/>
  <xsl:param name="style"/>
  <xsl:value-of select="$before"/>
  <xsl:apply-templates/>
  <xsl:value-of select="$after"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Parameter startNamespace
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="startNamespace">\color{red}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter startElement
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="startElement">{</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter highlightStartElementName
Namespace No namespace
Used by
Supersedes
Source
<xsl:param name="highlightStartElementName">\textcolor{red}{</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter highlightEndElementName
Namespace No namespace
Used by
Supersedes
Source
<xsl:param name="highlightEndElementName">}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter startElementName
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="startElementName">\textbf{</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter startAttribute
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="startAttribute">{</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter startAttributeValue
Namespace No namespace
Supersedes
Overriding
Source
<xsl:param name="startAttributeValue">{</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter startComment
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="startComment">\begin{it}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endElement
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endElement">}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endElementName
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endElementName">}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endComment
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endComment">\end{it}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endAttribute
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endAttribute">}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endAttributeValue
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endAttributeValue">}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter endNamespace
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="endNamespace"/>
Stylesheet location ../latex2/tei.xsl
Parameter spaceCharacter
Namespace No namespace
Supersedes
Parameter
Overriding
Parameter
Source
<xsl:param name="spaceCharacter">\hspace*{6pt}</xsl:param>
Stylesheet location ../latex2/tei.xsl
Variable docClass
Namespace No namespace
Overriding
Variable
Source
<xsl:variable name="docClass">
  <xsl:choose>
    <xsl:when test="/tei:TEI[@rend='letter']">
      <xsl:text>letter</xsl:text>
    </xsl:when>
    <xsl:when test="/tei:TEI[@rend='book']">
      <xsl:text>book</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>article</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>
Stylesheet location ../latex2/tei.xsl
Function tei:escapeCharsVerbatim (letters)
Documentation

Description

We need the backslash and two curly braces to insert LaTeX commands into the output, so these characters need to replaced when they are found in running text.

Namespace http://www.tei-c.org/ns/1.0
Type xs:string
Used by
Parameters
QName Namespace
letters No namespace
Import precedence 24
Source
<xsl:function name="tei:escapeCharsVerbatim" as="xs:string">
  <xsl:param name="letters"/>
  <xsl:value-of select="translate($letters, '\{}','⃥❴❵')"/>
</xsl:function>
Stylesheet location ../latex2/tei.xsl
Function tei:escapeChars (letters)
Namespace http://www.tei-c.org/ns/1.0
Type xs:string
Used by
Parameters
QName Namespace
letters No namespace
Import precedence 24
Source
<xsl:function name="tei:escapeChars" as="xs:string">
  <xsl:param name="letters"/>
  <xsl:value-of select="replace(replace(replace(replace(translate($letters,'
',' '),      '\\','\\textbackslash '),     '\{','\\{'),     '\}','\\}'),     '~','\\textasciitilde ')"/>
</xsl:function>
Stylesheet location ../latex2/tei.xsl
Output (default)
Namespace No namespace
Output properties
method encoding
Source
<xsl:output method="text" encoding="utf8"/>
Stylesheet location ../latex2/tei.xsl