9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Troff macro package for patents
Date: Thu,  7 Jun 2007 22:54:58 -0400	[thread overview]
Message-ID: <20070608025107.346AC1E8C1C@holo.morphisms.net> (raw)
In-Reply-To: <967166.27861.qm@web56202.mail.re3.yahoo.com>

> OK. They seem to have been decrufted from the source; nothing turns
> up with "grep jo" anyway. Better leave it to the archaeologists, I
> suppose.

I think Dennis was talking about an earlier program, not troff.
Troff does do line numbering in that style, using .nm and .nn.
>From the troff manual /sys/doc/troff.ps

15.  Output Line Numbering.

         Automatic sequence numbering of output lines may be
    requested  with nm.  When in effect, a three-digit, ara-
  3 bic number plus a digit-space is prefixed to output text
    lines.   The  text  lines are thus offset by four digit-
    spaces, and otherwise retain their line length; a reduc-
  6 tion  in  line  length  may be desired to keep the right
    margin aligned with an  earlier  margin.   Blank  lines,
    other vertical spaces, and lines generated by tl are not
  9 numbered.  Numbering can be temporarily  suspended  with
    nn, or with an .nm followed by a later .nm +0.  In addi-
    tion, a line number indent I, and the number-text  sepa-
 12 ration  S may be specified in digit-spaces.  Further, it
    can be specified that only those line numbers  that  are
    multiples of some number M are to be printed (the others
 15 will appear as blank number fields).

.nm ±N M S I             off       E

        Line number mode.  If ±N is given, line numbering is
        turned  on,  and  the  next  output line numbered is
        numbered ±N.  Default values are M=1, S=1, and  I=0.
        Parameters  corresponding  to  missing arguments are
        unaffected; a  non-numeric  argument  is  considered
        missing.  In the absence of all arguments, numbering
        is turned off; the next line number is preserved for
        possible further use in number register ln.

.nn N          -         N=1       E

        The next N text output lines are not numbered.

         As an example, the paragraph portions of this  sec-
    tion  are  numbered  with M=3: .nm 1 3 was placed at the
 18 beginning; .nm was placed at the end of the first  para-
    graph; and .nm +0 was placed in front of this paragraph;
    and .nm finally placed at the end.   Line  lengths  were
 21 also  changed  (by  \w'0000'u)  to  keep  the right side
    aligned.  Another example is .nm +5 5 x 3,  which  turns
    on numbering with the line number of the next line to be
 24 5 greater than the last numbered line,  with  M=5,  with
    spacing S untouched, and with the indent I set to 3.

Russ



  reply	other threads:[~2007-06-08  2:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-08  0:35 dmr
2007-06-08  2:25 ` gas
2007-06-08  2:54   ` Russ Cox [this message]
2007-06-08  4:46 dmr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070608025107.346AC1E8C1C@holo.morphisms.net \
    --to=rsc@swtch.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).