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 12177 2013-05-31 14:45:42Z rahtz $

Copyright: 2013, 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 25
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 25
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 25
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 25
Source
<xsl:template name="verbatim-newLine"/>
Stylesheet location ../latex2/tei.xsl
Template verbatim-Text
Namespace No namespace
Used by
References
Supersedes
Template
Parameters
QName Namespace
words No namespace
Import precedence 25
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 25
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 25
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 25
Source
<xsl:template name="applyRendition"/>
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 25
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 makeSpan
Namespace No namespace
Used by
Import precedence 25
Source
<xsl:template name="makeSpan">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template makeInline
Documentation

Description

inline objects
Namespace No namespace
Used by
References
Parameters
QName Namespace
after No namespace
before No namespace
style No namespace
Import precedence 25
Source
<xsl:template name="makeInline">
  <xsl:param name="before"/>
  <xsl:param name="style"/>
  <xsl:param name="after"/>
  <xsl:value-of select="$before"/>
  <xsl:choose>
    <xsl:when test="$style='bibl'">
      <xsl:text>\textit{</xsl:text>
      <xsl:value-of select="tei:escapeChars(normalize-space(.),.)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="$style='italic'">
      <xsl:text>\textit{</xsl:text>
      <xsl:value-of select="tei:escapeChars(normalize-space(.),.)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="$style='bold'">
      <xsl:text>\textbf{</xsl:text>
      <xsl:value-of select="tei:escapeChars(normalize-space(.),.)"/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:when test="$style=''">
      <xsl:sequence select="concat('\',local-name(),'{')"/>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:sequence select="concat('\',$style,'{')"/>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:value-of select="$after"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template makeBlock
Documentation

Description

block objects
Namespace No namespace
Used by
Parameters
QName Namespace
style No namespace
Import precedence 25
Source
<xsl:template name="makeBlock">
  <xsl:param name="style"/>
  <xsl:sequence select="concat('\begin{',$style,'}')"/>
  <xsl:apply-templates/>
  <xsl:sequence select="concat('\end{',$style,'}')"/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template lineBreak
Documentation

Description

make a line break
Namespace No namespace
Parameters
QName Namespace
id No namespace
Import precedence 25
Source
<xsl:template name="lineBreak">
  <xsl:param name="id"/>
  <xsl:text>\mbox{}\newline 
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template makeSection
Documentation

Description

division-like object
Namespace No namespace
Used by
Supersedes
Template
Parameters
QName Namespace
heading No namespace
implicitBlock No namespace
level No namespace
Import precedence 25
Source
<xsl:template name="makeSection">
  <xsl:param name="level"/>
  <xsl:param name="heading"/>
  <xsl:param name="implicitBlock">false</xsl:param>
  <xsl:text>
</xsl:text>
  <xsl:choose>
    <xsl:when test="$level=1">\section</xsl:when>
    <xsl:when test="$level=2">\subsection</xsl:when>
    <xsl:when test="$level=3">\subsubsection</xsl:when>
    <xsl:when test="$level=4">\paragraph</xsl:when>
  </xsl:choose>
  <xsl:text>{</xsl:text>
  <xsl:value-of select="$heading"/>
  <xsl:text>}
</xsl:text>
  <xsl:choose>
    <xsl:when test="$implicitBlock='true'">
      <xsl:text>\par
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>\par
</xsl:text>
    </xsl:when>
    <xsl:when test="*">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\par
</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>\par
</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Template makeWithLabel
Documentation

Description

text with a label
Namespace No namespace
Used by
Supersedes
Template
Parameters
QName Namespace
before No namespace
Import precedence 25
Source
<xsl:template name="makeWithLabel">
  <xsl:param name="before"/>
  <xsl:text>\textit{</xsl:text>
  <xsl:value-of select="$before"/>
  <xsl:text>}: </xsl:text>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/tei.xsl
Parameter outputTarget
Namespace No namespace
Used by
Supersedes
Parameter
Source
<xsl:param name="outputTarget">latex</xsl:param>
Stylesheet location ../latex2/tei.xsl
Parameter documentclass
Namespace No namespace
Overriding
Parameter
Source
<xsl:param name="documentclass">article</xsl:param>
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
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 25
Source
<xsl:function name="tei:escapeCharsVerbatim" as="xs:string">
  <xsl:param name="letters"/>
  <xsl:value-of select="replace(replace(replace(replace(translate($letters, '\{}','⃥❴❵'),     '_','\\textunderscore '),     '\^','\\textasciicircum '),     '~','\\textasciitilde '),     '([%&\$#])','\\$1')"/>
</xsl:function>
Stylesheet location ../latex2/tei.xsl
Function tei:escapeChars (letters, context)
Namespace http://www.tei-c.org/ns/1.0
Type xs:string
Used by
Parameters
QName Namespace
context No namespace
letters No namespace
Import precedence 25
Source
<xsl:function name="tei:escapeChars" as="xs:string" override="yes">
  <xsl:param name="letters"/>
  <xsl:param name="context"/>
  <xsl:value-of select="replace(replace(replace(replace(replace(translate($letters,'
',' '),      '\\','\\textbackslash '),     '_','\\textunderscore '),     '\^','\\textasciicircum '),     '~','\\textasciitilde '),     '([\}\{%&\$#])','\\$1')"/>
</xsl:function>
Stylesheet location ../latex2/tei.xsl
Function tei:escapeCharsPartial (letters)
Namespace http://www.tei-c.org/ns/1.0
Type xs:string
Used by
Template
Parameters
QName Namespace
letters No namespace
Import precedence 25
Source
<xsl:function name="tei:escapeCharsPartial" as="xs:string" override="yes">
  <xsl:param name="letters"/>
  <xsl:value-of select="replace($letters,'([#])','\\$1')"/>
</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