[xml/sgml-commit] [SCM] linuxdoc-tools package for Debian. branch, master, updated. debian/0.9.66-9-gae91c9e
Agustin Martin Domingo
agmartin at debian.org
Mon Oct 10 13:33:30 UTC 2011
The following commit has been merged in the master branch:
commit 4c0fecb6eb783211109541b21154ce54ca9aac4a
Author: Agustin Martin Domingo <agmartin at debian.org>
Date: Fri Oct 7 12:14:08 2011 +0200
fmt_txt.pl: Put txt output in a single large page. 99999 lines should be enough. (#3180)
There were unpredictable gaps between some environments in txt output.
This looks like a page-break related problem, seems that with previous
code groff is breaking pages in a supposedly continuous text output,
and things are joined in a page-break.
We make sure that groff thinks page is a really large single page, so
the above does not happen. Implemented method was explaind in Groff
mailing list by Anton Shepelev.
First, we set a really large page length and instead of explicitly
resetting pagelength at the end if the file, just use an end-of-input
trap to set the real page-length in the end.
References:
http://lists.gnu.org/archive/html/groff/2011-02/msg00020.html
http://www.groff-wiki.info/EmittingOnePage
diff --git a/lib/fmt/fmt_txt.pl b/lib/fmt/fmt_txt.pl
index 55b6413..7d19a4e 100644
--- a/lib/fmt/fmt_txt.pl
+++ b/lib/fmt/fmt_txt.pl
@@ -317,6 +317,21 @@ $txt->{postASP} = sub
my $txtout = ( $global->{language} eq "en" ) ? "" : ".nr HY 0\n";
my $txtout0 = "$txtout";
+ # Put document in a single large page. 99999 lines should be enough.
+ $txtout .= q/.\" Trim page to total height of text.
+.de sp-adj
+. br
+. pl \\n[nl]u
+..
+.
+.\" Set single-page mode
+.de sp-set
+. pl 99999
+. em sp-adj
+..
+.sp-set
+/;
+
while ( <$INFILE> ) { # Feed $txtout with roff input.
$txtout0 .= $_;
unless (/^\.DS/.../^\.DE/) {
--
linuxdoc-tools package for Debian.
More information about the debian-xml-sgml-commit
mailing list