Your message dated Fri, 29 Apr 2011 10:21:27 +0200
with message-id <11353.1304065287@manetheren>
has caused the report #623590,
regarding dblatex: PDF do not support
<filename><replaceable>...</replaceable></filename>
to be marked as having been forwarded to the upstream software
author(s) Benoit Guillon <[email protected]>
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
623590: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623590
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Hi BenoƮt,
I want to inform you of dblatex Debian BTS report #623590 [1]:
Inside a <filename> element a <replaceable> element is not rendered
using an italics font like it is done normally. Thus the replaceable
part of the file name is not distinguishable from the other parts.
A patch suggestion is attached for your review: [2]
[1] http://bugs.debian.org/623590
[2]
Author: Andreas Hoenen <[email protected]>
Description: Hotfix for BTS report #623590:
Render <replaceable> elements inside of <filename> elements like other
<replaceable> elements: use an italics type.
--- a/xsl/inlined.xsl
+++ b/xsl/inlined.xsl
@@ -218,6 +218,10 @@
</xsl:template>
<xsl:template match="filename">
+ <xsl:apply-templates select="text()|replaceable" mode="filename"/>
+</xsl:template>
+
+<xsl:template match="text()[name(..)='filename']" mode="filename">
<xsl:choose>
<!-- \Url cannot stand in a section heading -->
<xsl:when test="$filename.as.url='1' and
@@ -232,6 +236,23 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
+
+<xsl:template match="replaceable" mode="filename">
+ <xsl:choose>
+ <!-- \Url cannot stand in a section heading -->
+ <xsl:when test="$filename.as.url='1' and
+ not(ancestor::title or ancestor::refentrytitle)">
+ <!-- Guess hyperref is always used now. -->
+ <xsl:call-template name="nolinkurl-output">
+ <xsl:with-param name="url" select="."/>
+ <xsl:with-param name="command">\italicsurl</xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="inline.italicmonoseq"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
<xsl:template match="function">
<xsl:choose>
--- a/latex/style/dbk_hyper.sty
+++ b/latex/style/dbk_hyper.sty
@@ -27,4 +27,5 @@
\usepackage{hyperref}
\def\hyperlabel#1{}
}
+\DeclareUrlCommand{\italicsurl}{\def\UrlFont{\itshape\ttfamily}}
--- a/xsl/url.xsl
+++ b/xsl/url.xsl
@@ -20,12 +20,14 @@
-->
<xsl:template name="nolinkurl2">
<xsl:param name="url" select="@url"/>
+ <xsl:param name="command"/>
<xsl:variable name="bscount">
<xsl:call-template name="bslash-end-count">
<xsl:with-param name="url" select="$url"/>
</xsl:call-template>
</xsl:variable>
- <xsl:text>\nolinkurl{</xsl:text>
+ <xsl:value-of select="$command"/>
+ <xsl:text>{</xsl:text>
<xsl:call-template name="scape-encode">
<xsl:with-param name="string" select="$url"/>
</xsl:call-template>
@@ -65,6 +67,7 @@
-->
<xsl:template name="nolinkurl-output">
<xsl:param name="url" select="@url"/>
+ <xsl:param name="command">\nolinkurl</xsl:param>
<xsl:variable name="url2">
<xsl:choose>
<!-- Behaviour depending on the texlive version -->
@@ -85,12 +88,14 @@
<xsl:when test="ancestor::entry or ancestor::revision or ancestor::footnote">
<xsl:call-template name="nolinkurl-escape">
<xsl:with-param name="url" select="$url2"/>
+ <xsl:with-param name="command" select="$command"/>
</xsl:call-template>
<!-- FIXME: do something with '&' and revision if needed -->
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="nolinkurl-escape">
<xsl:with-param name="url" select="$url2"/>
+ <xsl:with-param name="command" select="$command"/>
<xsl:with-param name="chars" select="' '"/>
</xsl:call-template>
</xsl:otherwise>
@@ -141,6 +146,7 @@
<xsl:template name="nolinkurl-escape">
<xsl:param name="escchars"/>
<xsl:param name="url"/>
+ <xsl:param name="command"/>
<xsl:param name="chars" select="'#% '"/>
<xsl:variable name="len" select="string-length($url)"/>
@@ -162,6 +168,7 @@
<xsl:if test="$len != 0">
<xsl:call-template name="nolinkurl2">
<xsl:with-param name="url" select="$url"/>
+ <xsl:with-param name="command" select="$command"/>
</xsl:call-template>
</xsl:if>
</xsl:when>
@@ -170,6 +177,7 @@
<xsl:with-param name="escchars"
select="concat($escchars, '\', substring($url,1,1))"/>
<xsl:with-param name="url" select="substring($url, 2)"/>
+ <xsl:with-param name="command" select="$command"/>
<xsl:with-param name="chars" select="$chars"/>
</xsl:call-template>
</xsl:when>
@@ -181,11 +189,13 @@
</xsl:if>
<xsl:call-template name="nolinkurl2">
<xsl:with-param name="url" select="substring($url, 1, $pos)"/>
+ <xsl:with-param name="command" select="$command"/>
</xsl:call-template>
<xsl:call-template name="nolinkurl-escape">
<xsl:with-param name="escchars"
select="concat('\', substring($url,$pos+1,1))"/>
<xsl:with-param name="url" select="substring($url, $pos+2)"/>
+ <xsl:with-param name="command" select="$command"/>
<xsl:with-param name="chars" select="$chars"/>
</xsl:call-template>
</xsl:otherwise>
Regards, Andreas
--
Andreas Hoenen <[email protected]>
GPG: 1024D/B888D2CE
A4A6 E8B5 593A E89B 496B
82F0 728D 8B7E B888 D2CE
pgpy41g1Am5Mx.pgp
Description: PGP signature
--- End Message ---