groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] pdfmom grep (was parallel text processing)


From: Peter Schaffter
Subject: Re: [Groff] pdfmom grep (was parallel text processing)
Date: Sun, 10 Sep 2017 15:47:14 -0400
User-agent: Mutt/1.5.24 (2015-08-30)

Ralph --

On Sun, Sep 10, 2017, Ralph Corderoy wrote:
> I've neatened this up a bit, and show non-zero exits, and a SIGPIPE.
> 
> >             pdfmom -k camus.mom
> >             sh -c groff -Tpdf -dLABEL.REFS=1 -mom ...
> >             groff -Tpdf -dLABEL.REFS=1 -mom -z -k camus.mom
> >     exit(1) grep ^\\. *ds
> >             groff -Tpdf -dPDF.EXPORT=1 -dLABEL.REFS=1 -mom -z - -k camus.mom
> >             grep ^\\. *ds
> >             groff -Tpdf -mom -k - camus.mom
> >             preconv - camus.mom
> >     PIPE    troff -dPDF.EXPORT=1 -dLABEL.REFS=1 -mom -z -Tpdf
> >             preconv camus.mom
> >             troff -dLABEL.REFS=1 -mom -z -Tpdf
> >             troff -mom -Tpdf
> >             preconv - camus.mom
> >             gropdf
> 
> Let's go through it a step at a time to see if I can get across the
> problem.  Back to pdfmom...
> 
> >   groff -Tpdf -dLABEL.REFS=1 -mom -z $preconv $cmdstring 2>&1 | 
> >   grep '^\\. *ds' |
> >   groff -Tpdf -dPDF.EXPORT=1 -dLABEL.REFS=1 -mom -z - $preconv $cmdstring 
> > 2>&1 |
> >   grep '^\\. *ds' |
> >   groff -Tpdf -mom $preconv - $cmdstring
> 
> I run that manually.
> 
>     $ preconv=-k
>     $ cmdstring=camus.mom
>     $ groff -Tpdf -dLABEL.REFS=1 -mom -z $preconv $cmdstring 2>&1
>     camus.mom:18: can't translate character code 233 to special
>         character `'e' in transparent throughput
>     $
> 
> There's no /^\.ds/ in that output, explaining why the first grep in
> strace's output exit'd 1, so the stdin to the second groff is empty and
> it's as if the first groff and grep didn't exist in this case.

That's as expected; LABEL.REFS doesn't trip '.tm .ds whatever' in
this case because there are no forward references pointing to label
numbers.

> Onto the second groff.
> 
>     $ groff -Tpdf -dPDF.EXPORT=1 -dLABEL.REFS=1 -mom -z - $preconv $cmdstring 
> 2>&1
>     ^D^D^D^D
>     .ds pdf:look(pdf:bm1) L'�tranger
>     camus.mom:18: can't translate character code 233 to special
>         character `'e' in transparent throughput
>     $
> 
> ...
> 
> Here's the problem.  Whatever is producing that `.ds' line is writing
> ISO 8859-1, and my UTF-8 terminal rightly replaces it with `�', U+FFFD.

In pdfmom, calling $preconv just once, in the final groff pass,
fixes the problem.

While I was working on flex spacing for mom 2.2, I encountered a
problem that was handily fixed by $preconv being part of each of the
groff invocations.  Neither Deri nor I spotted the consequences of
the preconv(1) conversion on the upcoming grep.  Thinking too much
in English, I guess.  At any rate, the problem got fixed elsewhere,
obviating the need for the superfluous $preconv's.

> We're being told there was a problem too, in both this groff and the
> previous one, with the `can't translate' warning.  Decimal 233 is U+E9
> that's the `é' in

The warning's coming from pdf.tmac, line 262, and can safely be
ignored because it doesn't prevent the correct rendering of accented
characters in the pdf outline.

Thanks so much for the help with this.

Cheers.

-- 
Peter Schaffter
http://www.schaffter.ca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]