pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Lakhin <exclusion@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Rendering pi more nicely in PDF
Date: Mon, 27 Apr 2020 19:00:01 +0300
Message-ID: <40367f31-64c9-8713-b7c2-760a055ac74d@gmail.com> (raw)
In-Reply-To: <25094.1587999854@sss.pgh.pa.us>
References: <10598.1587928415@sss.pgh.pa.us>
	<664f9462-54b1-256c-69f1-9795c5055a40@gmail.com>
	<25094.1587999854@sss.pgh.pa.us>

27.04.2020 18:04, Tom Lane wrote:
> Alexander Lakhin <exclusion@gmail.com> writes:
>> 26.04.2020 22:13, Tom Lane wrote:
>> BTW, I tried to also use this <phrase> markup inside the template for
>> <returnvalue>, so we'd only need one font-switching special case not two.
>> Didn't work though --- apparently templates don't get applied recursively?
>> Oh well.
We can have a single template "symbol_font" and reuse it, but it doesn't
seem cleaner to me (for just two cases).
(Placing <phrase ...>  into <xsl:template match="returnvalue"> wouldn't
work as such a content goes into the output, whilst all xsl:templates
apply to the input tree.)

Best regards,
Alexander

Attachments:

single_symbol_font_template.patch (text/x-patch, 1.1K) download diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl index 2f2517d8ce..38c96737d5 100644 --- a/doc/src/sgml/stylesheet-fo.xsl +++ b/doc/src/sgml/stylesheet-fo.xsl @@ -92,7 +92,7 @@ <!-- overrides stylesheet-common.xsl --> <!-- FOP needs us to be explicit about the font to use for right arrow --> <xsl:template match="returnvalue"> - <fo:inline font-family="{$symbol.font.family}">&#x2192; </fo:inline> + <xsl:call-template name="symbol_font"><xsl:with-param name="content" select="'&#x2192; '"/></xsl:call-template> <xsl:call-template name="inline.monoseq"/> </xsl:template> @@ -102,8 +102,9 @@ </xsl:template> <!-- FOP needs us to be explicit about use of symbol font in some cases --> -<xsl:template match="phrase[@role='symbol_font']"> - <fo:inline font-family="{$symbol.font.family}"><xsl:value-of select="."/></fo:inline> +<xsl:template name="symbol_font" match="phrase[@role='symbol_font']"> + <xsl:param name="content" select="."/> + <fo:inline font-family="{$symbol.font.family}"><xsl:value-of select="$content"/></fo:inline> </xsl:template> <!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->

view thread (11+ messages)  latest in thread

Message-ID: <40367f31-64c9-8713-b7c2-760a055ac74d@gmail.com>
Permalink:  ../40367f31-64c9-8713-b7c2-760a055ac74d@gmail.com/
Also on:    postgresql.org/message-id/40367f31-64c9-8713-b7c2-760a055ac74d@gmail.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: exclusion@gmail.com, tgl@sss.pgh.pa.us, pgsql-docs@lists.postgresql.org
  Subject: Re: Rendering pi more nicely in PDF
  In-Reply-To: <40367f31-64c9-8713-b7c2-760a055ac74d@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox