From a31f7546f769959c2dbb15d720ceaa6eb28d925b Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Tue, 18 Sep 2018 17:31:54 +0200 Subject: [PATCH] pdfman: fix -- --- pdfman/pdfman | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pdfman/pdfman b/pdfman/pdfman index ee2c5ed..3bd1c01 100755 --- a/pdfman/pdfman +++ b/pdfman/pdfman @@ -120,10 +120,20 @@ man -w "$@" | # Convert ˆ to ^ # remove lines like: . ds ^ \& perl -ne '/^\s*\.\s*ds\s+\S*\^/ or print' | - # replace ^ with \(ha - sed 's/\^/\\(ha/g' | - # Convert -- to - and '' to " - (echo '.tr \--'; perl -pe "s/''|\`\`/\"\"/g;") | + perl -pe ' + # replace ^ with \(ha + s/\^/\\(ha/g; + # replace \*(-- with \-\- + s/\\\*\(--/\-\-/g; + # replace \*(L" or \*(R" with " + s/\\\*\([LR]"/"/g; + ' | + # Todo ~ + # Convert -- to - + ( + echo '.tr \--'; + cat - + ) | man -tl - | perl -pe "s/'/\\\\010/g" | ps2pdf - >$pdf && pdfviewer $pdf