Hi Robin,

At 2026-03-12T23:08:45+0000, Robin Haberkorn via discussion of the GNU
roff typesetting system and related software wrote:
> On Thu Feb 5, 2026 at 04:00:31 GMT +01, G. Branden Robinson wrote:
> > Fortunately I have a workaround.
> >
> > If the very first thing you want to do in a document is blast a
> > device extension command to it, and you have already configured a
> > vertical position trap within the first vee of the document--or a
> > macro package has done so for you--then prefix that request or
> > escape sequence with the `\&` (dummy character) escape sequence.
> 
> I am not so sure we're through with this. I get some CI failures for
> one of my projects on Fedora Rawhide, which is currently on Groff
> 1.24.0-1.fc45.  .device requests result in "error: spurious end trap
> token detected!".  And they aren't the first thing in the document.
> Needless to say they worked on all previous versions of Groff.
> 
> I will have to reproduce this and minify some test case.

As it happens I just saw a similar thing when tweaking my groff-ified
version of Kernighan & Cherry's eqn user guide.[1]

I was using the `pdfpagenumbering` macro defined by tmac/pdf.tmac.

And it wasn't the "first thing" in the document.

However it _was_ the first thing in the document _that produced any
(device-independent) output (which I term "trout" or "grout" depending
on whether groff extensions are observable).

Here's how far you can get in an ms(7) document without producing any
"grout".

     1  .\" Adapted for groff by G. Branden Robinson, initially from 2022-06-30/
     2  .\" 07-02.  Thanks to Deri James for PDF support.
     3  .\"
     4  .\" These values, used with URW Times fonts at 10 points, produce column
     5  .\" and page breaks nearly identical to the C/A/T typeset original.
     6  .nr LL 5.4i
     7  .nr PO 1.55i
     8  .\" Define a fake Bell System logo.
     9  .char \[bs] \o'\[ci]|'
    10  .EQ
    11  delim $$
    12  .EN
    13  .
    14  .af year 0000
    15  .af mo 00
    16  .af dy 00
    17  .ND "August 15, 1978 \fI(retypeset with \fPgroff \n(.x.\n(.y.\n(.Y\fI\
    18   \n[year]-\n(mo-\n(dy)"
    19  .\" GBR: Suppress repetition of doc info and don't alter page numbering.
    20  .ie \n(.x=1&\n(.y>=23 .RP no-repeat-info no-renumber
    21  .el                   .RP no
    22  .\" Force page 1 to be numbered; it follows the cover page and the Unix
    23  .\" Programmer's Manual page headings (which these sources don't produce
    24  .\" anyway) are not appropriate for this document in isolation.
    25  .nr pg*P1 1
    26  .\"TM "76-1273-4 76-1271-4" 39199 39199-11
    27  .ds CF \fIgroff\fP \n(.x.\n(.y.\n(.Y
    28  .pdfpagenumbering roman
    29  .TL
    30  Typesetting Mathematics _ User's Guide
    31  \&\ \ \ \ \ (Second\ Edition)
    32  .AU 2C-518 6021
    33  Brian W. Kernighan and Lorinda L. Cherry

...if I move the `pdfpagenumbering` call after `TL`, everything is fine.

At this point, I still think my analysis holds, but my suggestion may
need revision; in an ms(7) document with a cover page, we don't want to
start the document with a dummy character; that interferes with `RP`.

s.tmac:g0:22: error: .RP is not allowed after the first page has started

However, it's fine to put the `pdfpagenumbering` call after the end of
the abstract.  It still works to mark the page number of the cover page
using (in the case shown above) lowercase Roman numerals.

I'm not sure there is a defect here, except to add documentation.  To
make device extension commands truly work "anywhere" still looks to me
like it would require some redesign of GNU troff internals.

See <https://savannah.gnu.org/bugs/?66187>.

Regards,
Branden

Attachment: signature.asc
Description: PGP signature

Reply via email to