Showing:

Documentation
Used by
References
Overriding
Included from
Source
Stylesheet textstructure.xsl
Documentation

Description

TEI stylesheet dealing with elements from the textstructure 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: textstructure.xsl 9329 2011-09-20 09:47:43Z rahtz $

Copyright: 2011, TEI Consortium

Included from
Stylesheet version 2.0
Template *innertext
Documentation

Description

Process elements * in inner mode
Namespace No namespace
Match *
Mode innertext
Import precedence 4
Source
<xsl:template match="*" mode="innertext">
  <xsl:apply-templates select="."/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:TEI
Documentation

Description

Namespace No namespace
Match tei:TEI
Mode #default
References
Template mainDocument
Import precedence 4
Source
<xsl:template match="tei:TEI">
  <xsl:call-template name="mainDocument"/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template mainDocument
Namespace No namespace
Used by
Template tei:TEI
References
Import precedence 4
Source
<xsl:template name="mainDocument">
  <xsl:if test="not($realFigures='true')">
    <xsl:text>%BEGINFIGMAP</xsl:text>
    <xsl:if test="not($latexLogo='')">
      <xsl:text>
%FIGMAP </xsl:text>
      <xsl:value-of select="$latexLogo"/>
      <xsl:text> FIG0 </xsl:text>
    </xsl:if>
    <xsl:for-each select="//tei:figure">
      <xsl:variable name="c">
        <xsl:number level="any"/>
      </xsl:variable>
      <xsl:text>
%FIGMAP </xsl:text>
      <xsl:variable name="f">
        <xsl:choose>
          <xsl:when test="@url">
            <xsl:value-of select="@url"/>
          </xsl:when>
          <xsl:when test="@entity">
            <xsl:value-of select="unparsed-entity-uri(@entity)"/>
          </xsl:when>
          <xsl:when test="tei:graphic">
            <xsl:value-of select="tei:graphic/@url"/>
          </xsl:when>
        </xsl:choose>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="contains($f,'.')">
          <xsl:value-of select="$f"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="concat($f,'.png')"/>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:text> FIG</xsl:text>
      <xsl:value-of select="$c + 1000"/>
      <xsl:text>
</xsl:text>
    </xsl:for-each>
    <xsl:text>
%ENDFIGMAP
</xsl:text>
  </xsl:if>
  <xsl:text>\documentclass[</xsl:text>
  <xsl:value-of select="$classParameters"/>
  <xsl:text>]{</xsl:text>
  <xsl:value-of select="$docClass"/>
  <xsl:text>}</xsl:text>
  <xsl:text>\makeatletter
</xsl:text>
  <xsl:call-template name="latexSetup"/>
  <xsl:call-template name="latexPackages"/>
  <xsl:call-template name="latexLayout"/>
  <xsl:text>
\@ifundefined{chapter}{%
    \def\DivI{\section}
    \def\DivII{\subsection}
    \def\DivIII{\subsubsection}
    \def\DivIV{\paragraph}
    \def\DivV{\subparagraph}
    \def\DivIStar[#1]#2{\section*{#2}}
    \def\DivIIStar[#1]#2{\subsection*{#2}}
    \def\DivIIIStar[#1]#2{\subsubsection*{#2}}
    \def\DivIVStar[#1]#2{\paragraph*{#2}}
    \def\DivVStar[#1]#2{\subparagraph*{#2}}
}{%
    \def\DivI{\chapter}
    \def\DivII{\section}
    \def\DivIII{\subsection}
    \def\DivIV{\subsubsection}
    \def\DivV{\paragraph}
    \def\DivIStar[#1]#2{\chapter*{#2}}
    \def\DivIIStar[#1]#2{\section*{#2}}
    \def\DivIIIStar[#1]#2{\subsection*{#2}}
    \def\DivIVStar[#1]#2{\subsubsection*{#2}}
    \def\DivVStar[#1]#2{\paragraph*{#2}}
}
\def\TheFullDate{</xsl:text>
  <xsl:call-template name="generateDate"/>
  <xsl:variable name="revdate">
    <xsl:call-template name="generateRevDate"/>
  </xsl:variable>
  <xsl:if test="not($revdate='')">
    <xsl:text> (</xsl:text>
    <xsl:call-template name="i18n">
      <xsl:with-param name="word">revisedWord</xsl:with-param>
    </xsl:call-template>:
    <xsl:value-of select="$revdate"/>
    <xsl:text>)</xsl:text>
  </xsl:if>
  <xsl:text>}
\def\TheID{</xsl:text>
  <xsl:choose>
    <xsl:when test="not($REQUEST='')">
      <xsl:value-of select="not($REQUEST='')"/>
    </xsl:when>
    <xsl:when test="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno">
      <xsl:value-of select="ancestor-or-self::tei:TEI/tei:teiHeader/tei:fileDesc/tei:publicationStmt/tei:idno[1]"/>
    </xsl:when>
  </xsl:choose>
  <xsl:text>\makeatother </xsl:text>
  <xsl:text>}
\def\TheDate{</xsl:text>
  <xsl:call-template name="generateDate"/>
  <xsl:text>}
\title{</xsl:text>
  <xsl:call-template name="generateTitle"/>
  <xsl:text>}
\author{</xsl:text>
  <xsl:call-template name="generateAuthor"/>
  <xsl:text>}</xsl:text>
  <xsl:text disable-output-escaping="yes">\let\tabcellsep&
      \catcode`\&=12\relax </xsl:text>
  <xsl:text>\makeatletter </xsl:text>
  <xsl:call-template name="latexBegin"/>
  <xsl:text>\makeatother </xsl:text>
  <xsl:text>
\begin{document}
</xsl:text>
  <xsl:if test="not(tei:text/tei:front/tei:titlePage)">
    <xsl:call-template name="printTitleAndLogo"/>
  </xsl:if>
  <xsl:call-template name="beginDocumentHook"/>
  <!-- certainly don't touch the next few lines -->
  <xsl:text>
\catcode`\$=12\relax
</xsl:text>
  <xsl:text>\catcode`\^=12\relax
</xsl:text>
  <xsl:text>\catcode`\#=12\relax
</xsl:text>
  <xsl:text>\catcode`\%=12\relax
</xsl:text>
  <xsl:apply-templates/>
  <xsl:call-template name="latexEnd"/>
  <xsl:if test="key('ENDNOTES',1)">
    <xsl:text>
\theendnotes</xsl:text>
  </xsl:if>
  <xsl:text>
\end{document}
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:teiHeader
Documentation

Description

Processing teiHeader elements
Namespace No namespace
Match tei:teiHeader
Mode #default
Import precedence 4
Source
<xsl:template match="tei:teiHeader"/>
Stylesheet location ../latex2/textstructure.xsl
Template tei:back
Documentation

Description

Namespace No namespace
Match tei:back
Mode #default
Import precedence 4
Source
<xsl:template match="tei:back">
  <xsl:if test="not(preceding::tei:back)">
    <xsl:text>\backmatter </xsl:text>
  </xsl:if>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:body
Documentation

Description

Namespace No namespace
Match tei:body
Mode #default
References
Key APP
Import precedence 4
Source
<xsl:template match="tei:body">
  <xsl:if test="not(ancestor::tei:floatingText) and not(preceding::tei:body) and preceding::tei:front">
    <xsl:text>\mainmatter </xsl:text>
  </xsl:if>
  <xsl:if test="count(key('APP',1))>0">\beginnumbering</xsl:if>
  <xsl:apply-templates/>
  <xsl:if test="count(key('APP',1))>0">\endnumbering</xsl:if>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:body|tei:back|tei:frontinnertext
Documentation

Description

Namespace No namespace
Match tei:body|tei:back|tei:front
Mode innertext
Import precedence 4
Source
<xsl:template match="tei:body|tei:back|tei:front" mode="innertext">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:closer
Documentation

Description

Namespace No namespace
Match tei:closer
Mode #default
Import precedence 4
Source
<xsl:template match="tei:closer">
  <xsl:text>
\begin{quote}</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>\end{quote}
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:dateline
Documentation

Description

Namespace No namespace
Match tei:dateline
Mode #default
Import precedence 4
Source
<xsl:template match="tei:dateline">
  <xsl:text>\rightline{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Documentation

Description

Process the tei:div elements
Namespace No namespace
Match tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5
Mode #default
Import precedence 4
Source
<xsl:template match="tei:div|tei:div1|tei:div2|tei:div3|tei:div4|tei:div5">
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:divGen[@type='toc']
Documentation

Description

Table of contents
Namespace No namespace
Match tei:divGen[@type='toc']
Mode #default
Overriding
Import precedence 4
Source
<xsl:template match="tei:divGen[@type='toc']">\tableofcontents</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:divGen[@type='bibliography']
Documentation

Description

Bibliography
Namespace No namespace
Match tei:divGen[@type='bibliography']
Mode #default
References
Template bibliography
Import precedence 4
Source
<xsl:template match="tei:divGen[@type='bibliography']">
  <xsl:text>
\begin{thebibliography}{1}
</xsl:text>
  <xsl:call-template name="bibliography"/>
  <xsl:text>
\end{thebibliography}
</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:front
Documentation

Description

Namespace No namespace
Match tei:front
Mode #default
Import precedence 4
Source
<xsl:template match="tei:front">
  <xsl:if test="not(preceding::tei:front)">
    <xsl:text>\frontmatter </xsl:text>
  </xsl:if>
  <xsl:apply-templates/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:opener
Documentation

Description

Namespace No namespace
Match tei:opener
Mode #default
Import precedence 4
Source
<xsl:template match="tei:opener">\begin{quote}
  <xsl:apply-templates/>\end{quote}</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:l
Documentation

Description

If verseNumbering is requested, counts all the verse lines since the last container (div1 by default) and labels every fifth verse using a LaTeX box 3 ems wide.
Namespace No namespace
Match tei:l
Mode #default
References
Import precedence 4
Source
<xsl:template match="tei:l">
  <xsl:choose>
    <xsl:when test="$verseNumbering='true'">
      <xsl:variable name="id" select="generate-id()"/>
      <xsl:variable name="pos">
        <xsl:for-each select="ancestor::*[name()=$resetVerseLineNumbering]//l">
          <xsl:if test="generate-id()=$id">
            <xsl:value-of select="position()"/>
          </xsl:if>
        </xsl:for-each>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$pos mod $everyHowManyLines = 0">
          <xsl:text>\leftline{\makebox[3em][r]{</xsl:text>
          <xsl:value-of select="$pos"/>
          <xsl:text>}\quad{}</xsl:text>
          <xsl:apply-templates/>
          <xsl:text>}</xsl:text>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>\leftline{\makebox[3em][r]{}\quad{}</xsl:text>
          <xsl:apply-templates/>
          <xsl:text>}</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="ancestor::tei:quote and following-sibling::tei:l">
      <xsl:apply-templates/>\\</xsl:when>
    <xsl:when test="parent::tei:sp">
      <xsl:apply-templates/>
      <xsl:text>\hfill\\</xsl:text>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>\leftline{</xsl:text>
      <xsl:apply-templates/>
      <xsl:text>}</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:text
Documentation

Description

Namespace No namespace
Match tei:text
Mode #default
Import precedence 4
Source
<xsl:template match="tei:text">
  <xsl:choose>
    <xsl:when test="parent::tei:TEI">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:when test="parent::tei:group">
      <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>\par \hrule \begin{quote} \begin{small}
      <xsl:apply-templates mode="innertext"/>\end{small} \end{quote} \hrule \par</xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:titlePage/tei:docTitle
Documentation

Description

Namespace No namespace
Match tei:titlePage/tei:docTitle
Mode #default
Import precedence 4
Source
<xsl:template match="tei:titlePage/tei:docTitle">
  <xsl:text>\title{</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>}</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:titlePage
Namespace No namespace
Match tei:titlePage
Mode #default
Import precedence 4
Source
<xsl:template match="tei:titlePage">\begin{titlepage}
  <xsl:apply-templates/>\maketitle \end{titlepage} \cleardoublepage</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template tei:trailer
Namespace No namespace
Match tei:trailer
Mode #default
Import precedence 4
Source
<xsl:template match="tei:trailer">
  <xsl:text>

\begin{raggedleft}</xsl:text>
  <xsl:apply-templates/>
  <xsl:text>\end{raggedleft}

</xsl:text>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl
Template bibliography
Documentation

Description

[latex] make a bibliography
Namespace No namespace
Used by
Import precedence 4
Source
<xsl:template name="bibliography">
  <xsl:apply-templates mode="biblio" select="//tei:ref[@type='cite'] | //tei:ptr[@type='cite']"/>
</xsl:template>
Stylesheet location ../latex2/textstructure.xsl