|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
xmlns:exsl="http://exslt.org/common"
|
|
Packit Service |
76cb02 |
exclude-result-prefixes="exsl" 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 |
<xsl:param name="mediaobject.caption.style">\slshape</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="imagedata.default.scale">pagebound</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="imagedata.file.check">1</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="imagedata.boxed">0</xsl:param>
|
|
Packit Service |
76cb02 |
<xsl:param name="keep.relative.image.uris" select="0"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="mediaobject.select.idx">
|
|
Packit Service |
76cb02 |
<xsl:param name="olist" select="imageobject|imageobjectco"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="role" select="'dblatex'"/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$olist[@role=$role]">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
count($olist[1]/preceding-sibling::*) + 1"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="1"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="opt.extract">
|
|
Packit Service |
76cb02 |
<xsl:param name="optgroup"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="opt"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="contains($optgroup,$opt)">
|
|
Packit Service |
76cb02 |
<xsl:variable name="s" select="substring-after($optgroup,$opt)"/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($s,',')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="normalize-space(substring-before($s,','))"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="normalize-space($s)"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="image.setup">
|
|
Packit Service |
76cb02 |
<xsl:variable name="maxwidth">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="opt.extract">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="optgroup" select="$imagedata.default.scale"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="opt" select="'maxwidth='"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="maxheight">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="opt.extract">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="optgroup" select="$imagedata.default.scale"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="opt" select="'maxheight='"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:if test="$maxwidth!=''">
|
|
Packit Service |
76cb02 |
<xsl:text>\def\imgmaxwidth{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$maxwidth"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="$maxheight!=''">
|
|
Packit Service |
76cb02 |
<xsl:text>\def\imgmaxheight{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$maxheight"/>
|
|
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 name="image.autosize">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
contains($imagedata.default.scale,'maxwidth=') or
|
|
Packit Service |
76cb02 |
contains($imagedata.default.scale,'maxheight=')">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="1"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="0"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="align.environment2">
|
|
Packit Service |
76cb02 |
<xsl:param name="align"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="align-default" select="'center'"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$align = 'right'">
|
|
Packit Service |
76cb02 |
<xsl:text>flushright</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$align = 'left'">
|
|
Packit Service |
76cb02 |
<xsl:text>flushleft</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$align = 'center'">
|
|
Packit Service |
76cb02 |
<xsl:text>center</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$align-default"/>
|
|
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 match="videoobject">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="videodata"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="audioobject">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="audiodata"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="textobject">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="mediaobject/caption" mode="environment">
|
|
Packit Service |
76cb02 |
<xsl:param name="parent-align"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="align">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="align.environment2">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="align" select="@align"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="align-default" select="$parent-align"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:value-of select="concat('\begin{',$align,'}
')"/>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="."/>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="concat('\end{',$align,'}
')"/>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="mediaobject/caption">
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$mediaobject.caption.style"/>
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:apply-templates/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="mediaobject/caption" mode="subfigure">
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$mediaobject.caption.style"/>
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
the text and normalize it (no \par in it)
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
<xsl:call-template name="normalize-scape">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="string" select="."/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
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 match="mediaobject|inlinemediaobject">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="count(ancestor::figure/mediaobject[imageobject])"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="mediaobject.alone">
|
|
Packit Service |
76cb02 |
<xsl:if test="self::mediaobject and not(parent::figure)">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="1"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
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 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="(imageobject|imageobjectco)[position()=$idx]"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="viewport">
|
|
Packit Service |
76cb02 |
<xsl:if test="$img">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
mode="viewport"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
In case of a viewport, it is processed by imagedata, so keep the default
|
|
Packit Service |
76cb02 |
here -->
|
|
Packit Service |
76cb02 |
<xsl:variable name="align">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
not($img/descendant::imagedata/@align) or
|
|
Packit Service |
76cb02 |
$viewport=1">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="'center'"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="align.environment2">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="$img/descendant::imagedata/@align"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
within a figure don't put each mediaobject into a separate paragraph,
|
|
Packit Service |
76cb02 |
to let the subfigures correctly displayed.
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
<xsl:if test="$mediaobject.alone = 1">
|
|
Packit Service |
76cb02 |
<xsl:text>
\noindent</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{minipage}[c]{\linewidth}
</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="concat('\begin{',$align,'}
')"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="self::inlinemediaobject">
|
|
Packit Service |
76cb02 |
<xsl:text>\noindent</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$img">
|
|
Packit Service |
76cb02 |
<xsl:if test="$imagedata.file.check='1'">
|
|
Packit Service |
76cb02 |
<xsl:text>\imgexists{</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="$img/descendant::imagedata"
|
|
Packit Service |
76cb02 |
mode="filename.get"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}{</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="$img"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$imagedata.file.check='1'">
|
|
Packit Service |
76cb02 |
<xsl:text>}{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="textobject[1]"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="textobject[1]"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:if test="caption and ($figcount <= 1)">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="caption" mode="environment">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="parent-align" select="$align"/>
|
|
Packit Service |
76cb02 |
</xsl:apply-templates>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="$mediaobject.alone = 1">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="concat('\end{',$align,'}
')"/>
|
|
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="imageobject">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
select="count(ancestor::figure/mediaobject[imageobject])"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$figcount > 1">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
subfigures unless forced by @role -->
|
|
Packit Service |
76cb02 |
<xsl:if test="not(ancestor::figure/@role='flow.inline')">
|
|
Packit Service |
76cb02 |
<xsl:text> </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>\subfigure</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="../caption">
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="../caption" mode="subfigure"/>
|
|
Packit Service |
76cb02 |
<xsl:text>][</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="../caption"/>
|
|
Packit Service |
76cb02 |
<xsl:text>]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="$imagedata.boxed = '1'">
|
|
Packit Service |
76cb02 |
<xsl:text>\fbox{</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="imagedata"/>
|
|
Packit Service |
76cb02 |
<xsl:if test="$imagedata.boxed = '1'">
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="$figcount > 1">
|
|
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 name="unit.eval">
|
|
Packit Service |
76cb02 |
<xsl:param name="length"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="prop" select="''"/>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($length, '%') and substring-after($length, '%')=''">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="number(substring-before($length, '%')) div 100"/>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$prop"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="contains($length, 'px') and substring-after($length, 'px')=''">
|
|
Packit Service |
76cb02 |
<xsl:message>Pixel unit not handled (replaced by pt)</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="number(substring-before($length, 'px'))"/>
|
|
Packit Service |
76cb02 |
<xsl:text>pt</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="$length and (number($length)=$length)">
|
|
Packit Service |
76cb02 |
<xsl:message>Pixel unit not handled (replaced by pt)</xsl:message>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$length"/>
|
|
Packit Service |
76cb02 |
<xsl:text>pt</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$length"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="image.default.set">
|
|
Packit Service |
76cb02 |
<xsl:variable name="auto">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="image.autosize"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="$auto=1">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>width=\imgwidth,height=\imgheight,keepaspectratio=true</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$imagedata.default.scale"/>
|
|
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="graphic.begin.get">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="ancestor::imageobjectco">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="ancestor::imageobjectco" mode="graphic.begin"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>\includegraphics</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="graphic.end.get">
|
|
Packit Service |
76cb02 |
<xsl:if test="ancestor::imageobjectco">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="ancestor::imageobjectco" mode="graphic.end"/>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imagedata|graphic|inlinegraphic" mode="filename.get">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@entityref">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="@fileref">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="@fileref"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="@fileref">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="contains(., ':') or starts-with(.,'/')">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:value-of select="."/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$keep.relative.image.uris != 0">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:value-of select="."/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:call-template name="relative-uri">
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imagedata" mode="viewport">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
(@contentwidth or @contentdepth or @scale or
|
|
Packit Service |
76cb02 |
(@scalefit and @scalefit='0'))">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="1"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="0"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imagedata" name="imagedata">
|
|
Packit Service |
76cb02 |
<xsl:param name="layout.width" select="'\linewidth'"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="layout.height" select="'\textheight'"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="graphic.begin">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="graphic.begin.get"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="graphic.end">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="graphic.end.get"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="piangle">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="pi.dblatex_angle">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="node" select=".."/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="filename">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="filename.get"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="width">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="unit.eval">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="length" select="@width"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="prop" select="$layout.width"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="depth">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="unit.eval">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="length" select="@depth"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="prop" select="$layout.height"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
scale. TDG says that viewport spec without content/scale and scalefit=0
|
|
Packit Service |
76cb02 |
is ignored. -->
|
|
Packit Service |
76cb02 |
<xsl:variable name="viewport">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="." mode="viewport"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="widthperct">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
substring-after(@contentwidth, '%')=''">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
div 100"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="0"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:variable name="depthperct">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
substring-after(@contentdepth, '%')=''">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
div 100"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="0"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="$viewport=1">
|
|
Packit Service |
76cb02 |
<xsl:text>\begin{minipage}[c]</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="@depth">
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$depth"/>
|
|
Packit Service |
76cb02 |
<xsl:text>]</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@valign='bottom'">
|
|
Packit Service |
76cb02 |
<xsl:text>b</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="@valign='middle'">
|
|
Packit Service |
76cb02 |
<xsl:text>c</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="@valign='top'">
|
|
Packit Service |
76cb02 |
<xsl:text>t</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:text>c</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>]</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@width">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$width"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="ancestor::mediaobject">
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$layout.width"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$layout.width"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@align='center'">
|
|
Packit Service |
76cb02 |
<xsl:text>\centering </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="@align='left'">
|
|
Packit Service |
76cb02 |
<xsl:text>\raggedright </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="@align='right'">
|
|
Packit Service |
76cb02 |
<xsl:text>\raggedleft </xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="auto">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="image.autosize"/>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
<xsl:if test="$auto=1 or $widthperct!=0 or $depthperct!=0">
|
|
Packit Service |
76cb02 |
<xsl:text>\imgevalsize{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$filename"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$graphic.begin"/>
|
|
Packit Service |
76cb02 |
<xsl:text>[</xsl:text>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="@contentwidth or @contentdepth">
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="$widthperct!=0 and $widthperct=$depthperct">
|
|
Packit Service |
76cb02 |
<xsl:text>scale=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$widthperct"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:if test="@contentwidth">
|
|
Packit Service |
76cb02 |
<xsl:text>width=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="unit.eval">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="length" select="@contentwidth"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="prop" select="'\imgrwidth'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
<xsl:text>,</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="@contentdepth">
|
|
Packit Service |
76cb02 |
<xsl:text>height=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="unit.eval">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="length" select="@contentdepth"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="prop" select="'\imgrheight'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="@scale">
|
|
Packit Service |
76cb02 |
<xsl:text>scale=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="number(@scale) div 100"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:when test="(not(@scalefit) or @scalefit='1') and (@width or @depth)">
|
|
Packit Service |
76cb02 |
<xsl:if test="@width">
|
|
Packit Service |
76cb02 |
<xsl:text>width=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$width"/>
|
|
Packit Service |
76cb02 |
<xsl:text>,</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:if test="@depth">
|
|
Packit Service |
76cb02 |
<xsl:text>height=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$depth"/>
|
|
Packit Service |
76cb02 |
<xsl:text>,</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>keepaspectratio=true</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:otherwise>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="image.default.set"/>
|
|
Packit Service |
76cb02 |
</xsl:otherwise>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="@format = 'PRN'">
|
|
Packit Service |
76cb02 |
<xsl:text>,angle=270</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="$piangle != ''">
|
|
Packit Service |
76cb02 |
<xsl:text>,angle=</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$piangle"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:text>]{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$filename"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:value-of select="$graphic.end"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:if test="$viewport=1">
|
|
Packit Service |
76cb02 |
<xsl:text>\end{minipage}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:if>
|
|
Packit Service |
76cb02 |
<xsl:text>}</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|
|
Packit Service |
76cb02 |
|