|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
version="1.0">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit Service |
76cb02 |
############################################################################ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
The inlined output and the annotation content output are different (use
|
|
Packit Service |
76cb02 |
of attachfile macros, and latex file output). -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:param name="annotation.support" select="'0'"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:key name="gid" match="*" use="generate-id()"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="annotation" mode="write">
|
|
Packit Service |
76cb02 |
<xsl:text>\documentclass</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="$latex.class.options!=''">
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$latex.class.options"/>
|
|
Packit Service |
76cb02 |
<xsl:text>]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>{article}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\usepackage[T1]{fontenc}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\usepackage[latin1]{inputenc}
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="font.setup"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\usepackage[hyperlink]{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$latex.style"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="citation.setup"/>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="lang.setup"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\pagestyle{empty}
</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{document}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{document}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="annotation" mode="build.texfile">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="write.text.chunk">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="filename">
|
|
Packit Service |
76cb02 |
<xsl:text>annot_</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="generate-id()"/>
|
|
Packit Service |
76cb02 |
<xsl:text>.rtex</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:with-param>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="method" select="'text'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="content">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="write"/>
|
|
Packit Service |
76cb02 |
</xsl:with-param>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="encoding" select="$chunker.output.encoding"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="annotation"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="*" mode="annotation.links">
|
|
Packit Service |
76cb02 |
<xsl:if test="$annotation.support != '0'">
|
|
Packit Service |
76cb02 |
<xsl:variable name="id" select="(@id|@xml:id)[1]"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="aids">
|
|
Packit Service |
76cb02 |
<xsl:if test="$id!=''">
|
|
Packit Service |
76cb02 |
<xsl:for-each select="//annotation">
|
|
Packit Service |
76cb02 |
<xsl:if test="contains(concat(' ',@annotates,' '),concat(' ',$id,' '))">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="generate-id()"/>
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:for-each>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="normalize-space(@annotations) != ''">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="annotations-pointed-to">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="normalize-space(@annotations)"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="$aids != ''">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="apply-annotations-by-gid">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="gids" select="normalize-space($aids)"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="annotations-pointed-to">
|
|
Packit Service |
76cb02 |
<xsl:param name="annotations"/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($annotations, ' ')">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="key('id', substring-before($annotations, ' '))"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$a">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="generate-id($a)"/>
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="annotations-pointed-to">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="substring-after($annotations, ' ')"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="key('id', $annotations)"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$a">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="generate-id($a)"/>
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="apply-annotations-by-gid">
|
|
Packit Service |
76cb02 |
<xsl:param name="gids"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($gids, ' ')">
|
|
Packit Service |
76cb02 |
<xsl:variable name="gid" select="substring-before($gids, ' ')"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
mode="annotation-inline"/>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="apply-annotations-by-gid">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="gids" select="substring-after($gids, ' ')"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
mode="annotation-inline"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="annotation" mode="annotation-inline">
|
|
Packit Service |
76cb02 |
<xsl:text>\attachfile</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="title">
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>subject={</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="normalize-scape">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="string" select="title"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>}]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>annot_</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="generate-id()"/>
|
|
Packit Service |
76cb02 |
<xsl:text>.pdf</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="annotation.setup">
|
|
Packit Service |
76cb02 |
<xsl:if test="$annotation.support != '0' and .//annotation">
|
|
Packit Service |
76cb02 |
<xsl:text>\usepackage{attachfile}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select=".//annotation" mode="build.texfile"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|