Showing:

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

Description

TEI stylesheet dealing with elements from the figures module.

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: figures.xsl 9329 2011-09-20 09:47:43Z rahtz $

Copyright: 2011, TEI Consortium

Included from
Stylesheet version 2.0
Template tei:figurexref
Documentation

Description

Process element figure
Namespace No namespace
Match tei:figure
Mode xref
References
Parameter numberFigures
Template i18n
Import precedence 1
Source
<xsl:template match="tei:figure" mode="xref">
  <xsl:choose>
    <xsl:when test="$numberFigures='true'">
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">figureWord</xsl:with-param>
      </xsl:call-template>
      <xsl:text> </xsl:text>
      <xsl:choose>
        <xsl:when test="ancestor::tei:front">
          <xsl:number count="tei:figure[tei:head]" from="tei:front" level="any"/>
        </xsl:when>
        <xsl:when test="ancestor::tei:back">
          <xsl:number count="tei:figure[tei:head]" from="tei:back" level="any"/>
        </xsl:when>
        <xsl:when test="ancestor::tei:body">
          <xsl:number count="tei:figure[tei:head]" from="tei:body" level="any"/>
        </xsl:when>
      </xsl:choose>
      <xsl:if test="tei:head">
        <xsl:text>, </xsl:text>
        <xsl:apply-templates mode="plain" select="tei:head"/>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>this figure</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/figures.xsl
Template tei:tablexref
Documentation

Description

Process element table
Namespace No namespace
Match tei:table
Mode xref
References
Parameter numberTables
Template i18n
Overriding
Template tei:tablexref
Import precedence 1
Source
<xsl:template match="tei:table" mode="xref">
  <xsl:choose>
    <xsl:when test="$numberTables='true'">
      <xsl:call-template name="i18n">
        <xsl:with-param name="word">tableWord</xsl:with-param>
      </xsl:call-template>
      <xsl:text> </xsl:text>
      <xsl:number level="any"/>
      <xsl:if test="tei:head">
        <xsl:text>. </xsl:text>
        <xsl:apply-templates mode="plain" select="tei:head"/>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="tei:head">
          <xsl:apply-templates mode="plain" select="tei:head"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:text>table</xsl:text>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location ../common2/figures.xsl
Template graphicsAttributes
Documentation

Description

[latex] Analyze attributes of graphics inclusion

Parameters

mode Type of output (fo, html, latex) being created

Namespace No namespace
Used by
Templates makePic; makePic
References
Parameter standardScale
Parameters
QName Namespace
mode No namespace
Import precedence 1
Source
<xsl:template name="graphicsAttributes">
  <xsl:param name="mode">fo</xsl:param>
  <xsl:if test="@width">
    <xsl:choose>
      <xsl:when test="contains(@width,'%')">
        <xsl:choose>
          <xsl:when test="$mode='fo'">
            <xsl:attribute name="content-width">
              <xsl:value-of select="@width"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="$mode='latex'">
            <xsl:text>width=</xsl:text>
            <xsl:value-of select="number(substring-before(@width,'%')) div 100"/>
            <xsl:text>\textwidth,</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:attribute name="width">
              <xsl:value-of select="@width"/>
            </xsl:attribute>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="w">
          <xsl:choose>
            <xsl:when test="contains(@width,'pt')">
              <xsl:value-of select="@width"/>
            </xsl:when>
            <xsl:when test="contains(@width,'px') and $mode='latex'">
              <xsl:value-of select="substring-before(@width,'px')"/>
              <xsl:text>pt</xsl:text>
            </xsl:when>
            <xsl:when test="contains(@width,'in')">
              <xsl:value-of select="@width"/>
            </xsl:when>
            <xsl:when test="contains(@width,'px')">
              <xsl:value-of select="@width"/>
            </xsl:when>
            <xsl:when test="contains(@width,'cm')">
              <xsl:value-of select="@width"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@width"/>
              <xsl:text>pt</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="$mode='fo'">
            <xsl:attribute name="content-width">
              <xsl:value-of select="$w"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="$mode='latex'">
            <xsl:text>width=</xsl:text>
            <xsl:value-of select="$w"/>
            <xsl:text>,</xsl:text>
          </xsl:when>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
  <xsl:if test="@height">
    <xsl:choose>
      <xsl:when test="contains(@height,'%')">
        <xsl:choose>
          <xsl:when test="$mode='fo'">
            <xsl:attribute name="content-height">
              <xsl:value-of select="@height"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="$mode='latex'">
            <xsl:text>height=</xsl:text>
            <xsl:value-of select="number(substring-before(@height,'%')) div 100"/>
            <xsl:text>\textheight,</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:attribute name="height">
              <xsl:value-of select="@height"/>
            </xsl:attribute>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="h">
          <xsl:choose>
            <xsl:when test="contains(@height,'pt')">
              <xsl:value-of select="@height"/>
            </xsl:when>
            <xsl:when test="contains(@height,'px') and $mode='latex'">
              <xsl:value-of select="substring-before(@height,'px')"/>
              <xsl:text>pt</xsl:text>
            </xsl:when>
            <xsl:when test="contains(@height,'in')">
              <xsl:value-of select="@height"/>
            </xsl:when>
            <xsl:when test="contains(@height,'px')">
              <xsl:value-of select="@height"/>
            </xsl:when>
            <xsl:when test="contains(@height,'cm')">
              <xsl:value-of select="@height"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="@height"/>
              <xsl:text>pt</xsl:text>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="$mode='fo'">
            <xsl:attribute name="content-height">
              <xsl:value-of select="$h"/>
            </xsl:attribute>
          </xsl:when>
          <xsl:when test="$mode='latex'">
            <xsl:text>height=</xsl:text>
            <xsl:value-of select="$h"/>
            <xsl:text>,</xsl:text>
          </xsl:when>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
  <xsl:variable name="s">
    <xsl:choose>
      <xsl:when test="@scale and contains(@scale,'%')">
        <xsl:value-of select="number(substring-before(@scale,'%')) div 100"/>
      </xsl:when>
      <xsl:when test="@scale">
        <xsl:value-of select="@scale"/>
      </xsl:when>
      <xsl:when test="not(@width) and not(@height) and not($standardScale=1)">
        <xsl:value-of select="$standardScale"/>
      </xsl:when>
    </xsl:choose>
  </xsl:variable>
  <xsl:if test="not($s='')">
    <xsl:choose>
      <xsl:when test="$mode='fo'">
        <xsl:attribute name="scale">
          <xsl:value-of select="$s"/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$mode='latex'">
        <xsl:text>scale=</xsl:text>
        <xsl:value-of select="$s"/>
        <xsl:text>,</xsl:text>
      </xsl:when>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location ../common2/figures.xsl