Doc: improve PDF presentation of some tables by adjusting column widths.
authorTom Lane <[email protected]>
Mon, 4 May 2020 20:16:42 +0000 (16:16 -0400)
committerTom Lane <[email protected]>
Mon, 4 May 2020 20:16:48 +0000 (16:16 -0400)
The PDF toolchain defaults to laying out all columns of a table with
equal widths, in contrast to the HTML rendering which automatically
varies the column widths to fit the data.  In many places, this
results in very badly laid-out tables, with lots of useless whitespace
in some places and text that overruns its cell in other places.

For tables that have reasonably static content, we can improve
matters by adding <colspec> entries to hand-assign the column widths.
This commit does that for a few of the tables that were worst off;
it eliminates close to 200 "contents ... exceed the available area"
warnings in an A4 PDF build.

I also forced align="left" in these tables, overriding the PDF
toolchain's default which is evidently "justify".  (The HTML toolchain
seems to default to that already.)  Anyplace where things are tight
enough that we need to worry about this, forced justification tends to
look truly awful.

doc/src/sgml/charset.sgml
doc/src/sgml/errcodes.sgml
doc/src/sgml/features.sgml
doc/src/sgml/generate-keywords-table.pl

index b6023fa459e6ee6740b1850656967b36cfd96872..04e71f17d30e648053fb3ae62c2da2ab9672fc2f 100644 (file)
@@ -95,6 +95,8 @@ initdb --locale=sv_SE
 
     <informaltable>
      <tgroup cols="2">
+      <colspec colname="col1" align="left" colwidth="1*"/>
+      <colspec colname="col2" align="left" colwidth="3*"/>
       <tbody>
        <row>
         <entry><envar>LC_COLLATE</envar></entry>
@@ -993,6 +995,13 @@ CREATE COLLATION ignore_accents (provider = icu, locale = 'und-u-ks-level1-kc-tr
      <table id="charset-table">
       <title><productname>PostgreSQL</productname> Character Sets</title>
       <tgroup cols="7">
+       <colspec colname="col1" align="left" colwidth="3*"/>
+       <colspec colname="col2" align="left" colwidth="2*"/>
+       <colspec colname="col3" align="left" colwidth="2*"/>
+       <colspec colname="col4" align="left" colwidth="1.25*"/>
+       <colspec colname="col5" align="left" colwidth="1*"/>
+       <colspec colname="col6" align="left" colwidth="1*"/>
+       <colspec colname="col7" align="left" colwidth="2*"/>
        <thead>
         <row>
          <entry>Name</entry>
@@ -1004,7 +1013,7 @@ CREATE COLLATION ignore_accents (provider = icu, locale = 'und-u-ks-level1-kc-tr
           The Bytes/Char field is populated by looking at the values returned
           by pg_wchar_table.mblen function for each encoding.
          -->
-         <entry>Bytes/Char</entry>
+         <entry>Bytes/&zwsp;Char</entry>
          <entry>Aliases</entry>
         </row>
        </thead>
@@ -1635,6 +1644,8 @@ RESET client_encoding;
     <table id="multibyte-translation-table">
      <title>Built-in Client/Server Character Set Conversions</title>
      <tgroup cols="2">
+      <colspec colname="col1" align="left" colwidth="1*"/>
+      <colspec colname="col2" align="left" colwidth="3*"/>
       <thead>
        <row>
         <entry>Server Character Set</entry>
@@ -1933,6 +1944,9 @@ RESET client_encoding;
     <table id="builtin-conversions-table">
      <title>All Built-in Character Set Conversions</title>
      <tgroup cols="3">
+      <colspec colname="col1" align="left" colwidth="2*"/>
+      <colspec colname="col2" align="left" colwidth="1*"/>
+      <colspec colname="col3" align="left" colwidth="1*"/>
       <thead>
        <row>
         <entry>Conversion Name
index 6fd16f643eaf35ddad13bb1be61d409439e00e88..f0ef0500339e28fcbd0910a1ad967923a09ee5a6 100644 (file)
@@ -66,8 +66,8 @@
  <title><productname>PostgreSQL</productname> Error Codes</title>
 
  <tgroup cols="2">
-  <colspec colnum="1" colname="errorcode"/>
-  <colspec colnum="2" colname="condname"/>
+  <colspec colnum="1" colname="errorcode" align="left" colwidth="1*"/>
+  <colspec colnum="2" colname="condname" align="left" colwidth="8*"/>
   <spanspec namest="errorcode" nameend="condname" spanname="span12"/>
 
   <thead>
index b4596a9eb24ecf447c142503aa66d8c374562fd9..330481ff6a1db7af0e4bc568c128b7a37f876b73 100644 (file)
    <para>
     <informaltable>
      <tgroup cols="4">
+      <colspec colname="col1" align="left" colwidth="1.5*"/>
+      <colspec colname="col2" align="left" colwidth="1*"/>
+      <colspec colname="col3" align="left" colwidth="7*"/>
+      <colspec colname="col4" align="left" colwidth="3*"/>
       <thead>
        <row>
         <entry>Identifier</entry>
 
     <informaltable>
      <tgroup cols="4">
+      <colspec colname="col1" align="left" colwidth="1.5*"/>
+      <colspec colname="col2" align="left" colwidth="1*"/>
+      <colspec colname="col3" align="left" colwidth="7*"/>
+      <colspec colname="col4" align="left" colwidth="3*"/>
       <thead>
        <row>
         <entry>Identifier</entry>
index 086a158e798a9110d4c24e175887915bdcec22b4..a975b058d8459d99d5b0828534fe2fe2f7d8bcbf 100644 (file)
@@ -56,6 +56,11 @@ print <<END;
  <title><acronym>SQL</acronym> Key Words</title>
 
  <tgroup cols="5">
+  <colspec colname="col1" align="left" colwidth="5*"/>
+  <colspec colname="col2" align="left" colwidth="3*"/>
+  <colspec colname="col3" align="left" colwidth="2*"/>
+  <colspec colname="col4" align="left" colwidth="2*"/>
+  <colspec colname="col5" align="left" colwidth="2*"/>
   <thead>
    <row>
     <entry>Key Word</entry>