Rendering pi more nicely in PDF - Mailing list pgsql-docs

From Tom Lane
Subject Rendering pi more nicely in PDF
Date
Msg-id 10598.1587928415@sss.pgh.pa.us
Whole thread Raw
Responses Re: Rendering pi more nicely in PDF  (Alexander Lakhin <exclusion@gmail.com>)
Re: Rendering pi more nicely in PDF  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-docs
In the department of nitpickery ...

"π" renders poorly in our PDF docs: as shown in the attached
screenshot, it doesn't line up on the baseline.  I realized that
this is the same problem I'd run into recently with right-arrow,
and it can be solved in the same way, namely we have to specify
use of the symbol font explicitly.  So attached is a proposed
patch to fix it.

Use of a new processing-instruction might not be the most elegant
way to do this ... anyone have a better suggestion?

(BTW, I tried to use "π" in the stylesheet files and it
didn't work; apparently that entity isn't loaded yet.)

            regards, tom lane

diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index b0afaeb..fdbd4a0 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1365,7 +1365,7 @@ repeat('Pg', 4) <returnvalue>PgPgPgPg</returnvalue>
         <function>pi</function> (  )
         <returnvalue>double precision</returnvalue>
        <?br?>
-        Approximate value of π
+        Approximate value of <?pi?>
        <?br?>
         <literal>pi()</literal>
         <returnvalue>3.141592653589793</returnvalue>
diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index 58a2aa3..01bec32 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -1528,7 +1528,7 @@ SELECT 4 AS four \; SELECT 5 AS five \aset
       <row>
        <entry><literal><function>pi()</function></literal></entry>
        <entry>double</entry>
-       <entry>value of the constant PI</entry>
+       <entry>value of the constant <?pi?></entry>
        <entry><literal>pi()</literal></entry>
        <entry><literal>3.14159265358979323846</literal></entry>
       </row>
diff --git a/doc/src/sgml/stylesheet-common.xsl b/doc/src/sgml/stylesheet-common.xsl
index b772f87..c9a9181 100644
--- a/doc/src/sgml/stylesheet-common.xsl
+++ b/doc/src/sgml/stylesheet-common.xsl
@@ -108,4 +108,8 @@
   <br/>
 </xsl:template>

+<!-- Support for generating pi symbol -->
+
+<xsl:template match="processing-instruction('pi')">π</xsl:template>
+
 </xsl:stylesheet>
diff --git a/doc/src/sgml/stylesheet-fo.xsl b/doc/src/sgml/stylesheet-fo.xsl
index 6797e06..7bfc819 100644
--- a/doc/src/sgml/stylesheet-fo.xsl
+++ b/doc/src/sgml/stylesheet-fo.xsl
@@ -101,6 +101,11 @@
   <fo:block/>
 </xsl:template>

+<!-- overrides stylesheet-common.xsl -->
+<xsl:template match="processing-instruction('pi')">
+  <fo:inline font-family="{$symbol.font.family}">π</fo:inline>
+</xsl:template>
+
 <!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->

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

Attachment

pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Clarified websearch_to_tqsuery syntax in textsearch.sgml
Next
From: yigong hu
Date:
Subject: Re: explanation for random_page_cost is outdated