Bug#979728: man pages: manuals created from docbook files need postprocessing
Package: texlive-binaries
Version: 2020.20200327.54578-5
Severity: minor
Dear Maintainer,
the attachment contains a shell script to fix man pages created from
a docbook file.
Main improvements are:
# Remove trailing spaces.
# Remove .PP after .SH and .SH.
# Remove '\&' before a period inside or after a word.
# '\&' suppresses kerning between characters on both sides of it.
# Break lines after a punctuation mark, before a parentheses.
# To make lines shorter and easier to edit and diff.
sed -e '/\\"/n' \
-e '/^\.TS,^\.TE/n' \
-e 's/ *$//' \
-e '/^\.S[SH]/{n; /\.PP/d}' \
-e 's/\([^ ]\)\\&\./\1./g' \
-e 's/\([^ ][.,;!?]\) */\1\n/g' \
-e 's/ (/\n(/g' $1
An example is "afm2pl.1".
-- System Information:
Debian Release: bullseye/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.10.4-1 (SMP w/2 CPU threads)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages texlive-binaries depends on:
ii dpkg 1.20.5
ii install-info 6.7.0.dfsg.2-5+b1
ii libc6 2.31-9
ii libcairo2 1.16.0-5
ii libfontconfig1 2.13.1-4.2
ii libfreetype6 2.10.4+dfsg-1
ii libgcc-s1 10.2.1-3
ii libgraphite2-3 1.3.14-1
ii libharfbuzz0b 2.6.7-1
ii libicu67 67.1-5
ii libkpathsea6 2020.20200327.54578-5
ii libmpfr6 4.1.0-3
ii libpaper1 1.1.28+b1
ii libpixman-1-0 0.40.0-1
ii libpng16-16 1.6.37-3
ii libptexenc1 2020.20200327.54578-5
ii libstdc++6 10.2.1-3
ii libsynctex2 2020.20200327.54578-5
ii libteckit0 2.5.10+ds1-3
ii libtexlua53 2020.20200327.54578-5
ii libtexluajit2 2020.20200327.54578-5
ii libx11-6 2:1.6.12-1
ii libxaw7 2:1.0.13-1.1
ii libxi6 2:1.7.10-1
ii libxmu6 2:1.1.2-2+b3
ii libxpm4 1:3.5.12-1
ii libxt6 1:1.2.0-1
ii libzzip-0-13 0.13.62-3.2
ii perl 5.32.0-6
ii t1utils 1.41-4
ii tex-common 6.15
ii zlib1g 1:1.2.11.dfsg-2
Versions of packages texlive-binaries recommends:
pn dvisvgm <none>
ii texlive-base 2020.20201203-2
texlive-binaries suggests no packages.
-- no debconf information
--
Bjarni I. Gislason
#!/bin/sh
set -efu
# Skip lines with comments.
# Skip tables.
# Remove trailing spaces.
# Remove .PP after .SH and .SH.
# Remove '\&' before a period inside or after a word.
# '\&' suppresses kerning between characters on both sides of it.
# Break lines after a punctuation mark, before a parentheses.
# To make lines shorter and easier to edit and diff.
sed -e '/\\"/n' \
-e '/^\.TS,^\.TE/n' \
-e 's/ *$//' \
-e '/^\.S[SH]/{n; /\.PP/d}' \
-e 's/\([^ ]\)\\&\./\1./g' \
-e 's/\([^ ][.,;!?]\) */\1\n/g' \
-e 's/ (/\n(/g' ${1:--}
Reply to: