groff
[Top][All Lists]
Advanced

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

Re: [BUG] gropdf: Hardcoded (spaces) indentation in .EX/.EE is ignored


From: G. Branden Robinson
Subject: Re: [BUG] gropdf: Hardcoded (spaces) indentation in .EX/.EE is ignored
Date: Sat, 17 Dec 2022 10:35:44 -0600

Hi Alex,

At 2022-12-17T14:37:59+0100, Alejandro Colomar wrote:
> In the Linux man-pages, the exmaple programs are written almost as if
> they were C programs; that is, we don't use .RS for indenting, or
> stuff like that.  We just dump the programs from the .c file, and do
> the minimal adaptations to make it work (e.g., transform - into \-).
> That makes them very maintainable.
> 
> However, when the examples are transformed into PDF (and don't
> remember about HTML, but chances are high it's also buggy) the
> indentation is broken:
> 
> <http://chuzzlewit.co.uk/LinuxManBook.pdf#pdf%3Abm11943>
> 
> Please have a look at it.

At least part of this looks like the same issue as with the suffixes(7)
page.  Lines with leading spaces, be they in table entries as there or
not, as here, are not being handled correctly, and that could be
throwing off subsequent arithmetic involving the drawing position.

*roff device-independent output knows nothing about tables; its language
is too simple and primitive for that.

I went ahead and took a look at the "grout" produced by the groff -Z
option for -Tps and -Tpdf, and I see nothing that surprises me.  The
font mounting positions are a little different--not a surprise because
the "ps" device has 2 fonts (SS, ZDR) that the "pdf" device does not
need and should not handle[1]--and the PDF output gets driver-specific
commands for placing PDF bookmarks at the (sub)section headings just as
we want.

"diff -U0" output attached.[2]

Regards,
Branden

[1] This _also_ came up recently.

    https://lists.gnu.org/archive/html/groff/2022-12/msg00095.html

[2] Boy, do I ever dislike the packing of multiple output commands to a
    line.  I recently learned[3] that SoftQuad modified their troff(1)
    output to be more readable/parsable by awk and friends.  With
    disciplined use of white space, you could even parse it with a shell
    script.  I already had a hankering to revise GNU troff's output to
    be more human-readable, and lo, the hankering strengthens.

[3] https://lists.gnu.org/archive/html/groff/2022-12/msg00097.html

Attachment: unix.7.ps-pdf.grout.diff
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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