bug-groff
[Top][All Lists]
Advanced

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

[bug #61266] [andoc] interacts poorly with page traps


From: G. Branden Robinson
Subject: [bug #61266] [andoc] interacts poorly with page traps
Date: Sun, 3 Oct 2021 06:47:14 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0

URL:
  <https://savannah.gnu.org/bugs/?61266>

                 Summary: [andoc] interacts poorly with page traps
                 Project: GNU troff
            Submitted by: gbranden
            Submitted on: Sun 03 Oct 2021 10:47:12 AM UTC
                Category: Macro - others
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

If you try to render all our man pages in one big PDF document, as I do, you
will find unhappy results as we transition from man(7) documents to our lone
mdoc(7) document and back.

Here's a chunk of script I use to produce such a document.


DIR=$1
MANS=($(find build -name "*.[157]" -and -not -path '*/tests/*'))

mkdir "$DIR"
cp build/doc/groff.pdf "$DIR"

for F in "${MANS[@]}"
do
    echo $F
    if [ -f "$F" ]
    then
        M=$(basename "$F")
        M=${M%.man}
        cp -l "$F" "$DIR"/"$M"
    else
        echo "warning: \"$F\" missing" >&2
    fi
done

./build/test-groff -ww -rCHECKSTYLE=3 -Tpdf -P-e -p -e -t -mandoc -rC1 \
    "$DIR"/*.1 "$DIR"/*.5 "$DIR"/*.7 > "$DIR"/man_pages.pdf


If you examine the resulting document, you will see bad things happen.

1. On page 262, the page footer is drawn right after the end of the man page
text, high up the page, and a horizontal line is drawn after it.  These
suggest that the `an-end` macro is being called, even though it was intended
only for continuous rendering mode (since PDF is paginated, that mode should
not be occurring here).
2. On page 262, a second page footer is drawn with is baseline at the exact
page bottom, with no margin.
3. On page 263, the header contains stale information from the previous
document (groff_man_style(7)), not the current page (groff_mdoc(7)).
4. On page 297, the last page of groff_mdoc(7) and the first page of
groff_me(7) are overprinted, with groff_me(7)'s footer again in the midst of
the page and a second footer again appears at the  page bottom with no
margin.
5. On pages 298-365 (the last), the footer continues to appear in the wrong
place, at the page bottom with no margin.

This mess is the result of a horrible web of interaction between several
features: continuous rendering support, andoc's macro language detection, and
(much older) page location traps and end-of-input traps.

The good news is that I think I've finally got all this sorted after months of
being aggrieved by it.

The bad news is that if you think THIS looks bad, try doing the equivalent
operation on groff 1.22.4.


...
troff: OLDPDF/eqn2graph.1:213: warning: can't find special character
'u0061_0304'
troff: OLDPDF/eqn2graph.1:215: warning: can't find special character
'u0061_030C'
troff: OLDPDF/groff_font.5:325: warning: can't find special character 'u02DC'
troff: OLDPDF/groff_font.5:608: warning: can't find special character '.j'
troff: OLDPDF/groff_font.5:971: warning: can't find special character 'vA'
warning: page 213: table text block will not fit on one page
troff: OLDPDF/groff_font.5:1051: warning: can't find special character 'bs'
troff: OLDPDF/groff_font.5:1139: warning: can't find special character '-+'
troff: OLDPDF/groff_font.5:1188: warning: can't find special character
'coproduct'
troff: OLDPDF/groff_font.5:1309: warning: can't find special character '+e'
troff: OLDPDF/groff_font.5:1324: warning: can't find special character
'u2661'
troff: OLDPDF/groff_font.5:1326: warning: can't find special character
'u2662'
pic:OLDPDF/groff_mmse.7:158: invalid input character code 133
troff: OLDPDF/groff_font.5:2: fatal error: input stack limit exceeded
(probable infinite loop)






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61266>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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