|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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 |
<xsl:param name="imageobjectco.hide" select="0"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="mediaobjectco">
|
|
Packit Service |
76cb02 |
<xsl:if test="not(parent::figure)">
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{minipage}{\linewidth}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="figure.begin"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="imageobjectco[1]"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="not(parent::figure)">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="figure.end"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{minipage}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imageobjectco">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="idx">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="mediaobject.select.idx"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="imageobject[position()=$idx]"/>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="calloutlist"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imageobjectco" mode="graphic.begin">
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{overpic}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imageobjectco" mode="graphic.end">
|
|
Packit Service |
76cb02 |
<xsl:text>
\picfactoreval</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="areaspec//area" mode="graphic"/>
|
|
Packit Service |
76cb02 |
<xsl:text>\end{overpic}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="coord.get">
|
|
Packit Service |
76cb02 |
<xsl:param name="axe"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="def"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="xy"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($xy, ',')">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$axe='x'">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="substring-before($xy, ',')"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="substring-after($xy, ',')"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:if test="$axe=$def">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$xy"/>
|
|
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 |
|
|
Packit Service |
76cb02 |
<xsl:template name="coord.check">
|
|
Packit Service |
76cb02 |
<xsl:param name="x"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$x!=''">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="string(number($x))='NaN'">
|
|
Packit Service |
76cb02 |
<xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>*** Error: </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$x"/>
|
|
Packit Service |
76cb02 |
<xsl:text>: invalid calspair coordinate</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:value-of select='1'/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="number($x)>10000">
|
|
Packit Service |
76cb02 |
<xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>*** Error: </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$x"/>
|
|
Packit Service |
76cb02 |
<xsl:text>: calspair out of range</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:value-of select='1'/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
coordinates -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="area" mode="graphic">
|
|
Packit Service |
76cb02 |
<xsl:variable name="x1y1">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="substring-before(@coords, ' ')"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="x2y2">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="substring-after(@coords, ' ')"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="x1">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.get">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="xy" select="$x1y1"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="axe" select="'x'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="def" select="'x'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="y1">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.get">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="xy" select="$x1y1"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="axe" select="'y'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="def" select="'x'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="x2">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.get">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="xy" select="$x2y2"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="axe" select="'x'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="def" select="'y'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="y2">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.get">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="xy" select="$x2y2"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="axe" select="'y'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="def" select="'y'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="coord.error">
|
|
Packit Service |
76cb02 |
<xsl:if test="$x1y1='' or $x2y2=''">
|
|
Packit Service |
76cb02 |
<xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:text>*** Error: </xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="@coords"/>
|
|
Packit Service |
76cb02 |
<xsl:text>: invalid calspair</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="'1'"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.check">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="x" select="$x1"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.check">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="x" select="$y1"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.check">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="x" select="$x2"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="coord.check">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="x" select="$y2"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="$coord.error=''">
|
|
Packit Service |
76cb02 |
<xsl:text>\calspair{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$x1 != '' and $x2 != ''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="(number($x1)+number($x2)) div 200"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="number(concat($x1, $x2)) div 100"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>}{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$y1 != '' and $y2 != ''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="(number($y1)+number($y2)) div 200"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="number(concat($y1, $y2)) div 100"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>}{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="latex.programlisting">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="co-tagin" select="''"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="co-tagout" select="''"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="co-hide" select="$imageobjectco.hide"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|