pdfman: fix --

This commit is contained in:
Ole Tange 2018-09-18 17:31:54 +02:00
parent ecea38a908
commit a31f7546f7

View file

@ -120,10 +120,20 @@ man -w "$@" |
# Convert ˆ to ^ # Convert ˆ to ^
# remove lines like: . ds ^ \& # remove lines like: . ds ^ \&
perl -ne '/^\s*\.\s*ds\s+\S*\^/ or print' | perl -ne '/^\s*\.\s*ds\s+\S*\^/ or print' |
# replace ^ with \(ha perl -pe '
sed 's/\^/\\(ha/g' | # replace ^ with \(ha
# Convert -- to - and '' to " s/\^/\\(ha/g;
(echo '.tr \--'; perl -pe "s/''|\`\`/\"\"/g;") | # replace \*(-- with \-\-
s/\\\*\(--/\-\-/g;
# replace \*(L" or \*(R" with "
s/\\\*\([LR]"/"/g;
' |
# Todo ~
# Convert -- to -
(
echo '.tr \--';
cat -
) |
man -tl - | man -tl - |
perl -pe "s/'/\\\\010/g" | perl -pe "s/'/\\\\010/g" |
ps2pdf - >$pdf && pdfviewer $pdf ps2pdf - >$pdf && pdfviewer $pdf