[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: "--" again; this time via passivetex
--GEn4szYucjS2InE7
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Fri, Oct 12, 2001 at 06:02:20PM +0200, Jirka Kosek wrote:
> PassiveTeX reads directly XML source so there is no preprocessing stage
> as in JadeTeX which can turn -- into -\/-\/. Standard TeX ligature
> processing cann't be turned off AFAIK. Maybe Sebastian could talk more
> on this topic.
>=20
> > Any ideas on how to fix it, or even whereabouts the bug is?
>=20
> If you want quick workaround, you can insert zero-width joining space
> character (?) between two -:
>=20
> <para>Two dashes or not two dashes: -​-?</para>
We already have a preprocessing stage of course: XSL-T. Here is some
XSL that works around the problem in a better way, by translating '--'
in the XML source into '-​-' in the XSL-FO.
Tim.
*/
<?xml version=3D'1.0'?>
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
xmlns:fo=3D"http://www.w3.org/1999/XSL/Format"
version=3D'1.0'>
<!-- This works around an xmltex bug: two or three dashes -->
<!-- together become a ligature. -->
<xsl:template name=3D"fix-dash">
<xsl:param name=3D"str"/>
<xsl:choose>
<xsl:when test=3D"contains($str,'--')">
<xsl:call-template name=3D"fix-dash">
<xsl:with-param name=3D"str">
<xsl:value-of select=3D"substring-before($str,'--')"/>
<xsl:text>-​-</xsl:text>
<xsl:value-of select=3D"substring-after($str,'--')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select=3D"$str"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match=3D"text()">
<xsl:call-template name=3D"fix-dash">
<xsl:with-param name=3D"str" select=3D"."/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>
--GEn4szYucjS2InE7
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE73o9hyaXy9qA00+cRAjeeAJ9YX2t3AsBR3Gs78zD5PLMJfHr3RACeIL31
/0pB0goPwZbXWh1/pMQXaJA=
=Sro3
-----END PGP SIGNATURE-----
--GEn4szYucjS2InE7--
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC