groff
[Top][All Lists]
Advanced

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

[Groff] Re: Roman Numeral Page Numbers Error on Page Breaks


From: Andrew J. Piziali
Subject: [Groff] Re: Roman Numeral Page Numbers Error on Page Breaks
Date: Tue, 13 Apr 2004 08:38:06 -0500 (CDT)

Robert, you wrote:

    Andrew J. Piziali wrote:

    >    When I added the request ".af % i" to format the page number in
    > the footer of an -ms document, groff started displaying the two
    > warning messages:

    >    Forward.ms:39: warning: numeric expression expected (got `i')
    >    Forward.ms:39: warning: missing closing delimiter

    > at each page break. (The "i" in "got `i'" is incremented at each
    > page break.)

    >   What is the correct way to select a page footer page number
    >   format?

    This works:

      .af PN i
      .ds CF \\n(PN
      .ds CH
      .LP
      This is some text.
      .bp
      .LP
      This is some more.

    The PN register is not documented; but take a look at the s.tmac
    source to see how -ms alters the format of page numbers - it does
    seem that \n(PN is the public interface to the page number, and
    should be documented as such.

For some reason, changing my even and odd footer definitions to use
\n(PN, rather than %, causes the front matter pages to have the wrong
page numbers and the ".af PN i" is ignored.  These are the footer
definitions:

    .EF '\\n(PN'\\*[bookTitle]''\"          even page footer
    '\"                                     odd page footer
    .\"                                     If this is a numbered
    .\"                                       chapter then display the
    .\"                                       chapter number in footer.
    .ie \n[numberedChapter] \{\
    .  nr pageFooterChapterNumber (\n(H1+1)
    .  OF ''Chapter \\n[pageFooterChapterNumber], 
\(lq\\\\*[chapterTitle]\(rq'\\n(PN'
    .\}
    .el \{\"                                else
    .  OF ''"\\\\*[chapterTitle]"'\\n(PN'\"   omit chapter number.
    .\}

and this is an example of attempting to change the page format to lower
case Roman numerals:

    .if (\n[FormattingFullBook] = 1) \{\#   If we are formatting the
    .  af % i\"                                full book, put the
    .  ps +12\"                                forward on page viii.
    .  ce 99
    Discard this page!
    .  bp
    Discard this page!
    .  bp 9
    .  ce
    .  ps
    .\}

For the time being, I am using "%" instead of \n(PN in the code above.



--
                                                        |
address@hidden                       ________------+------________
                                                       / \
                                                      *---*


reply via email to

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