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' |
perl -pe '
# replace ^ with \(ha # replace ^ with \(ha
sed 's/\^/\\(ha/g' | s/\^/\\(ha/g;
# Convert -- to - and '' to " # replace \*(-- with \-\-
(echo '.tr \--'; perl -pe "s/''|\`\`/\"\"/g;") | 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