groff
[Top][All Lists]
Advanced

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

Re: [Groff] Odd ms Macro Page Offset Register Behavior


From: Andrew J. Piziali
Subject: Re: [Groff] Odd ms Macro Page Offset Register Behavior
Date: Sun, 11 Jan 2004 17:23:10 -0600 (CST)

Heinz, you wrote:
    
    There was a discussion of the odd .nr PO behavior in February last
    year http://ffii.org/archive/mails/groff/2003/Feb/0021.html.  In
    short, it is suggested to use :

        .nr PO somevalue
        .po somevalue

    in pairs on the first page.

Thank you for the quick reply!  This solves the problem of disparate
page offsets on the first and subsequent pages.  However, it does not
explain why the ".nr PO somevalue" register assignment has no effect if
the conditional expression of a preceding .if command evaluates to
false.

This is still a concern because another formatting anomoly is also
affected by it.  The line length observed by page footers is influenced
by conditional expression evaluation and whether or not a user-defined
register is defined on the groff command line.

groff is invoked using:

    groff -rFormatterPass=1 -rPrologSourced=0 -e -p -t -ms -Tps -U -z \
      MyDocument.ms

    sed '/ACRONYM_OFF/!s/[A-Z]\{3,\}/\\s-1&\\s0/g' MyDocument.ms | \
      groff -rFormatterPass=2 -rPrologSourced=0 -e -p -t -ms -Tps -U \
      >MyDocument.ps

when formatting the production document.  When FormatterPass has the
value 1, the file /tmp/defs is written with forward reference register
and string definitions.  When FormatterPass has the value 2, the
document reads /tmp/defs and produces the formatted Postscript document.
This is accomplished with this code early in the document:

    .ie \n[FormatterPass]=1 \{
    .  open SecondPassFile /tmp/defs
    .\}
    .el .if \n[FormatterPass]=2 \{
    .  so /tmp/defs
    .  sy rm -f /tmp/defs
    .\}

The even and odd page footers are defined using .EF and .OF
respectively.  Currently, the page footers are not properly formatted
because (1) the page footers are wider than the line length, (2) the
first page footer has too little margin on the left and (3) all
subsequent pages have too little margin on the right.

If -rFormatterPass=2 is omitted from the groff command line or the
.ie/.el command sequence is removed, commented out or replaced by
".if 0", the page footers format properly.

Somehow, the value of a Boolean expression preceding subsequent
commands, such as ".nr PO ..." and .EF/.OF, determines whether or not
they behave as expected.

    


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

reply via email to

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