groff
[Top][All Lists]
Advanced

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

[Groff] Re: Disabling SGR in grotty(1): gory details


From: Werner LEMBERG
Subject: [Groff] Re: Disabling SGR in grotty(1): gory details
Date: Fri, 25 Oct 2002 17:28:08 +0200 (CEST)

> Yes, as it turns out, you can only see the difference if you run
> groff with -o1-, the way roff documents are formatted in FreeBSD.
> With the stock troffrc and troffrc-end this causes no ABSTRACT
> in this document.  After a bit of thinking, -o1- *should* cause
> this document to skip the ABSTRACT, but it isn't with this SGR
> disabling stuff in troffrc:
>
> .\" Disable SGR support in grotty(1).
> .if n \{\
> .  do nop \X'tty: sgr 0'
> .  sp -1
> .  nr nl 0-1
> .  nr % -1
> .\}
>
> I tried playing with \n[%] for a while, to no avail.  Can this
> version be fixed somehow so that -o1- works again?  (Hope I'm
> not asking for too much.)

Uh, oh, it took me a while to find the following solution.  I haven't
tested it extensively, but it seems to work.

  .if n \{\
  .  nr _C \n(.C
  .  cp 0
  .
  .  de address@hidden
  .  .
  .
  .  de1 address@hidden
  .    if \\n[.P] \{\
  .      rn address@hidden wh
  .      ds address@hidden
  .      nop \X'tty: sgr 0'
  .      sp -1
  .    \}
  .  .
  .  wh 0 address@hidden
  .
  .  rn wh address@hidden
  .
  .  de1 wh
  .    am1 \\$2 address@hidden
  .      address@hidden
  .    address@hidden
  .    address@hidden \\$1 \\$2
  .  .
  .
  .  cp \n[_C]
  .\}

The only drawback I can see right now is that for a certain time span
`.wh' is redefined.  If another macro package does the same, we have a
problem.  Anyway, this is rather unlikely IMHO.


    Werner

reply via email to

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