groff
[Top][All Lists]
Advanced

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

Re: [Groff] conditionals


From: Werner LEMBERG
Subject: Re: [Groff] conditionals
Date: Tue, 01 Jun 2010 13:47:30 +0200 (CEST)

> What I would oh-so-love to be able to do is
>
>       .if \n[EULA]=1 || \n[EULA]=3
>
> I wandered through the groff docs and didn't see any way to do that.
>
> A) Is there a way?

Yes, of course.  groff uses `:' and `&' for C's `||' and `&&'
operators.  This, for example, is in m.tmac:

  .if (\n[N]=3):(\n[N]=5) \{\
  .  nr Sectp 1
  .  nr Ej 1
  .\}

If you want spaces, you need more parentheses:

  .if ((\n[N] = 3) : (\n[N] = 5)) \{\
  .  nr Sectp 1
  .  nr Ej 1
  .\}


     Werner



reply via email to

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