Re: Getting our tables to render better in PDF output

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Getting our tables to render better in PDF output
Дата
Msg-id 9779.1586712791@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Getting our tables to render better in PDF output  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Getting our tables to render better in PDF output  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-docs
I wrote:
> So if we can get <returnvalue> to both insert a right arrow and switch the
> font to match <type>'s choice, this would work more or less decently, and
> it's probably cleaner than the bare-entity-reference approach I posted
> before.  I don't have the XSL skills to get that to work though.
> Anyone want to help out?

I educated myself a teensy bit about XSL, and unless I'm missing
something, this is really pretty darn trivial; the attached seems
to do the trick.

I experimented with the markup from <guimenuitem> and decided that
I didn't like their choice of a smaller font size in this context;
it looks better to me to leave the arrow full-size.  The important
thing to learn from that precedent seems to be that we have to
specify the font correctly, as indeed is mentioned in the docbook
documentation.  So it seems to work well to just use

    <fo:inline font-family="{$symbol.font.family}">→ </fo:inline>

(The extra space seems to be necessary, else the arrow ends up
adjacent to the type name.)

So I'm pretty happy with this implementation and will push forward.

            regards, tom lane

diff --git a/doc/src/sgml/stylesheet-common.xsl b/doc/src/sgml/stylesheet-common.xsl
index e148c90..5936d9a 100644
--- a/doc/src/sgml/stylesheet-common.xsl
+++ b/doc/src/sgml/stylesheet-common.xsl
@@ -49,6 +49,11 @@
   <xsl:call-template name="inline.charseq"/>
 </xsl:template>

+<xsl:template match="returnvalue">
+  →
+  <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
 <xsl:template match="structfield">
   <xsl:call-template name="inline.monoseq"/>
 </xsl:template>
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index ea75408..a3b6463 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -63,6 +63,12 @@
   </fo:inline>
 </xsl:template>

+<!-- overrides stylesheet-common.xsl -->
+<xsl:template match="returnvalue">
+  <fo:inline font-family="{$symbol.font.family}">→ </fo:inline>
+  <xsl:call-template name="inline.monoseq"/>
+</xsl:template>
+
 <!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->

 <xsl:template match="varlistentry/term" mode="xref-to">

В списке pgsql-docs по дате отправления:

Предыдущее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: pre-requiste for installation
Следующее
От: Alexander Lakhin
Дата:
Сообщение: Re: Getting our tables to render better in PDF output