groff
[Top][All Lists]
Advanced

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

Re: [Groff] nroff vs. troff conditional using escapes?


From: Keith Marshall
Subject: Re: [Groff] nroff vs. troff conditional using escapes?
Date: Tue, 26 Feb 2008 21:53:52 +0000
User-agent: KMail/1.9.1

On Tuesday 26 February 2008 03:53, Clarke Echols wrote:
> Michael(tm) Smith wrote:
> >   .PP
> >   For more information, see the preceding section (
> >   .t-or-n "Description" "DESCRIPTION"
> >   ) or the
> >   .t-or-n "Introduction" "INTRODUCTION"
> >   section for this document.
> >
> > And if I then view the rendered output of that, I get:
> >
> >   For more information, see the preceding section ( Description )
> >   or the Introduction section for this document.
> >
> > That is, an undesirable wordspace gets inserted after the between
> > the parens before and after the word "Description".
> >
> > Hence my question about whether there really is no way I could use
> > a set of escapes instead of a request...
> >
> >   --Mike
>
> Add the line-continuation escape inside the argument [Clarke's own 
> subsequently corrected version]: 
>
>     .PP
>     For more information, see the preceding section (\c
>     .t-or-n "Description\c" "DESCRIPTION\c"
>     ) or the
>     .t-or-n "Introduction" "INTRODUCTION"
>     section for this document.
>
> That will prevent insertion of whitespace where end-of-line occurs
> in the source file.

That's one perfectly reasonable way to do it.  Another, which is similar 
to the method adopted by the `.B' macro in -ms package, (for example), 
is to add additional optional suffix and prefix arguments to the macro 
expansion, e.g.:

  .de t-or-n
  .   ie t \
  .      nop \\$4\\$1\\$3
  .   el \
  .      nop \\$4\\$2\\$3
  ..

Then you can write the above example either as is, or in the equivalent 
alternative form:

  .PP
  For more information, see the preceding section
  .t-or-n "Description" "DESCRIPTION" ) (
  or the
  .t-or-n "Introduction" "INTRODUCTION"
  section for this document.

depending on which is best suited to your application.

Regards,
Keith.




reply via email to

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