|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit |
0f19cf |
############################################################################ -->
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:param name="example.default.position">[H]</xsl:param>
|
|
Packit |
0f19cf |
<xsl:param name="example.float.type">none</xsl:param>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template match="example">
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
(not(@floatstyle) and $example.float.type='none')">
|
|
Packit |
0f19cf |
<xsl:apply-templates select="." mode="block"/>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
<xsl:apply-templates select="." mode="float"/>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template match="example" mode="block">
|
|
Packit |
0f19cf |
<xsl:text>
\begin{longfloat}{example}{</xsl:text>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:apply-templates select="title"/>
|
|
Packit |
0f19cf |
<xsl:text>}
</xsl:text>
|
|
Packit |
0f19cf |
<xsl:apply-templates select="*[not(self::title)]"/>
|
|
Packit |
0f19cf |
<xsl:text>
\end{longfloat}
</xsl:text>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template match="example" mode="float">
|
|
Packit |
0f19cf |
<xsl:text>
\begin{example}</xsl:text>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:choose>
|
|
Packit |
0f19cf |
<xsl:when test="@floatstyle != ''">
|
|
Packit |
0f19cf |
<xsl:value-of select="@floatstyle"/>
|
|
Packit |
0f19cf |
</xsl:when>
|
|
Packit |
0f19cf |
<xsl:otherwise>
|
|
Packit |
0f19cf |
<xsl:value-of select="$example.default.position"/>
|
|
Packit |
0f19cf |
</xsl:otherwise>
|
|
Packit |
0f19cf |
</xsl:choose>
|
|
Packit |
0f19cf |
<xsl:text>
</xsl:text>
|
|
Packit |
0f19cf |
<xsl:apply-templates select="*[not(self::title)]"/>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:apply-templates select="title"/>
|
|
Packit |
0f19cf |
<xsl:text>
\end{example}
</xsl:text>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template match="informalexample">
|
|
Packit |
0f19cf |
<xsl:call-template name="label.id"/>
|
|
Packit |
0f19cf |
<xsl:apply-templates/>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
<xsl:template match="example/title">
|
|
Packit |
0f19cf |
<xsl:text>\caption</xsl:text>
|
|
Packit |
0f19cf |
<xsl:apply-templates select="." mode="format.title"/>
|
|
Packit |
0f19cf |
<xsl:call-template name="label.id">
|
|
Packit |
0f19cf |
<xsl:with-param name="object" select="parent::example"/>
|
|
Packit |
0f19cf |
</xsl:call-template>
|
|
Packit |
0f19cf |
</xsl:template>
|
|
Packit |
0f19cf |
|
|
Packit |
0f19cf |
</xsl:stylesheet>
|