groff
[Top][All Lists]
Advanced

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

Re: [Groff] Refer and mysterious comma


From: Tadziu Hoffmann
Subject: Re: [Groff] Refer and mysterious comma
Date: Thu, 30 Dec 2010 21:36:40 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

> - space between %D and a following comma from %P.
> - space before the full stop when %P is not used.

try following the date with a "\c", too:

   \\*([D\c

For aesthetics you might also want something like

  .if !"\\*([P"" \{.tr -\(en
  , S. \\*([P\c
  .tr -- \}

if you have page ranges specified as "78-85".


> I don't quite get the point with the commas in the
> definitions. Any help greatly appreciated!

When you're outputting the date, for example, you don't yet
know whether the pages field is set or not, so it would be
premature to output the comma already with the date, in case
there is no pages field (in which case you'd want the final
period flush with the date, without comma).  So instead you
say "hold the line, I'm not quite finished with this text,
so don't insert space here" (which is what the "\c" means)
and only insert the comma separating the fields when you're
outputting the next field.

(Of course, instead of testing the existence of fields one
by one, you could also test whether certain combinations of
fields are available, and provide specialized formatting for
these different combinations.)





reply via email to

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