groff
[Top][All Lists]
Advanced

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

Re: [Groff] Question re: Appending to a diversion


From: Clarke Echols
Subject: Re: [Groff] Question re: Appending to a diversion
Date: Tue, 20 Dec 2005 11:55:42 -0700
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

I found out why the diversions weren't appending.  It seems that I
had a macro defined in the test file, and a newer version in the
macro file that was being overwritten by the original.  I hate it
when that happens!

Thanks for your help.  I still have some snags I'm working on, but
things look much better now.

Clarke

Tadziu Hoffmann wrote:
 . If-else clauses look like this:

      .ie ... \{\
      ...
      .\}
      .el \{\
      .\}

   Note the trailing backslashes!  I think this was the reason of
   not getting more than a single footnote.


No, the reason for not getting more than one footnote was an
interesting syntactic "feature": the expression for the value
of a number register in a ".nr" request must be given as a
single argument (without spaces) unless you use parentheses
to indicate that the expression isn't finished yet with the
first space character:

  .nr footnote_flag \\n[footnote_flag] +1   \" doesn't work
  .nr footnote_flag \\n[footnote_flag]+1    \" works
  .nr footnote_flag (\\n[footnote_flag] +1) \" works

This is because it is also possible to give a 3rd argument
to ".nr", to be used as an auto-increment value whenever
that number register is accessed.

Of course, like Werner already said, in the case of
incrementing or decrementing a number register, you
can use the simpler syntax:

  .nr footnote_flag +1    \" works

Regarding if and if-else clauses with multi-line grouping:

  .ie ... \{
  ...
  .\}
  .el \{
  ...
  .\}

without the backslashes is syntactically correct, but gives
you extra blank lines (from the "\{" lines).  This can be
avoided with (note the dot):

  .ie ... \{.\" comment
  ...
  .\}
  .el \{.\" another comment
  ...
  .\}

(there was a discussion regarding this a while back on this
list).


Regarding footnotes: Clarke, you might also want to
take a look at the "Tutorial Examples" at the end of
the "Troff User's Manual".




_______________________________________________
Groff mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/groff





reply via email to

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