Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1jH2-000514-Ss for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2020 04:05:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j1jH1-000432-2e for pgsql-docs@arkaria.postgresql.org; Wed, 12 Feb 2020 04:05:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j1jH0-00042i-Or for pgsql-docs@lists.postgresql.org; Wed, 12 Feb 2020 04:05:14 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j1jGx-0005IK-2U for pgsql-docs@lists.postgresql.org; Wed, 12 Feb 2020 04:05:14 +0000 Received: by mail-lj1-x22f.google.com with SMTP id q8so658113ljb.2 for ; Tue, 11 Feb 2020 20:05:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=++rNJtqOnBTDTefjyNNbsqyUl51vSobw7jiaOhW9h1k=; b=ZSfo+KfzYkDklMCVo7gu6hI7TN1aVbO8mYSqG42llAmA4nzwCphj7G2YeefWsxPYdY V4C80bv/ac4olylYfnDkoJNHkR+FeOWHHyoH24iMkH880hm3nuTm/RPIwRFfnlqS5QqG tYcFxv96c4keOFE/rd32k9DwC5wToRQQSFLSwqFT/BqHCvMPNfvsPzRZDtkibKDWEBtV UbNUnIav8TKuy17gDecsWfDPtNloWOVir+CVGVp0ZdHo75mGwWOdQyIhBeBrH7DvE7fH QICtznjqcXvtnQ+8ux5qlbCtbnJyveD4wzxh/ByKozYv9Y8w5CjbtrWWBTzgf5e0TT5H 2R3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=++rNJtqOnBTDTefjyNNbsqyUl51vSobw7jiaOhW9h1k=; b=ekn+7cOY7DTA274QHiBHDcq1Bwwwi0/ZwiL4FXHS2HIs03Wid9p2q0UBoph9CSjVzs cGYObsW87iIZZboS853SPkcd/03uQVvHHod9pOjD6Xwv81NEG72R01nDbVrLx+0BHqn/ DLtxNVd4jf2ptglvtQubDjAQjDvONYiVMc1vgC3s5yNg5A1+JlSceVsRVX4OAZWjqwIS SJHkH3DwSk49l1e5x7hc2jSAiT2rGkIum1xG+weXbyLhb3L7rnoZgmXpxDcSJfP+unCO nHUcztQ0Rp81V9X/hDO/Gdqd0cXx0EayO2gJn+VfQXGcmfLLKNkGcm4rhOBN1cI/8m6b iq+w== X-Gm-Message-State: APjAAAXYlt9byErwCrHYR0EjvCkKZV8vPYT8pHrSzBjVT7MhJaf6C7LK p0ttdFL6GxuvxfNmUrp+iozgAo6k X-Google-Smtp-Source: APXvYqzupEZa5Oron5h6ByF9Cc1dL1y7KJ29E2e6HbqMsOEFTeyi2b39Y7098kYfdoXgvsCnwML92g== X-Received: by 2002:a2e:a490:: with SMTP id h16mr6381729lji.115.1581480309038; Tue, 11 Feb 2020 20:05:09 -0800 (PST) Received: from [1.0.0.7] ([178.155.4.213]) by smtp.gmail.com with ESMTPSA id w6sm2727472lfq.95.2020.02.11.20.05.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Feb 2020 20:05:08 -0800 (PST) Subject: Re: Getting our tables to render better in PDF output To: Tom Lane , pgsql-docs@lists.postgresql.org References: <9326.1581457869@sss.pgh.pa.us> From: Alexander Lakhin Message-ID: <8a99bdca-85ab-27d6-83b4-9fc7113839f2@gmail.com> Date: Wed, 12 Feb 2020 07:05:06 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <9326.1581457869@sss.pgh.pa.us> Content-Type: multipart/mixed; boundary="------------2C7AFA6CBA77CB8425CC5FE9" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------2C7AFA6CBA77CB8425CC5FE9 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Hello Tom, 12.02.2020 00:51, Tom Lane wrote: > The crummy formatting of our tables of functions and operators has > been an issue for a long time. To my mind, there are several things > that need to be addressed: > > * The layout is completely unfriendly to function descriptions that > run to more than a few words. > > * It's not very practical to have more than one example per function > (or at least, we seldom do so). > > * The results look completely awful in PDF format, because of the > narrow effectively-available space, plus the fact that the toolchain > will prefer to overprint following columns instead of breaking text > where there's no whitespace. Please look at a less invasive approach that we use at Postgres Pro for some time (mainly for improving the translated documentation, but it works for the original one too). The idea is to add zero-width spaces after/before some chars ('(', ',', '[', etc) to let fop split lines where desired. It has one disadvantage - it's not search-friendly (though maybe that is application-dependent). But if it's feasible, I think this approach can at least complement a manual tables reformatting. Decreasing a font size in the tables seems appropriate to me too. Best regards, Alexander --------------2C7AFA6CBA77CB8425CC5FE9 Content-Type: text/x-patch; charset=UTF-8; name="fix-pdf-overflow.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-pdf-overflow.patch" diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 0401a515df8..3be29dba9f1 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -169,10 +169,14 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/' %-A4.fo: stylesheet-fo.xsl %.sgml $(ALLSGML) $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type A4 -o $@ $(wordlist 1,2,$^) + $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@ + mv $@.tmp $@ %-US.fo: stylesheet-fo.xsl %.sgml $(ALLSGML) $(XMLLINT) $(XMLINCLUDE) --noout --valid $(word 2,$^) $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $(wordlist 1,2,$^) + $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) -o $@.tmp $(@D)/pg-customize-fo.xsl $@ + mv $@.tmp $@ %.pdf: %.fo $(ALL_IMAGES) $(FOP) -fo $< -pdf $@ diff --git a/doc/src/sgml/pg-customize-fo.xsl b/doc/src/sgml/pg-customize-fo.xsl new file mode 100644 index 00000000000..48978880126 --- /dev/null +++ b/doc/src/sgml/pg-customize-fo.xsl @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --------------2C7AFA6CBA77CB8425CC5FE9--