From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-docs@lists.postgresql.org
Subject: Rendering pi more nicely in PDF
Date: Sun, 26 Apr 2020 15:13:35 -0400
Message-ID: <10598.1587928415@sss.pgh.pa.us> (raw)
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
Attachments:render-pi-nicely.patch (text/x-diff, 2.0K) downloaddiff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgmlindex 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.sgmlindex 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.xslindex 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.xslindex 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">
bogus-pi-rendering.png (image/png, 24.3K) downloadview image
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: tgl@sss.pgh.pa.us, pgsql-docs@lists.postgresql.org
Subject: Re: Rendering pi more nicely in PDF
In-Reply-To: <10598.1587928415@sss.pgh.pa.us>
* 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