🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.text
Article #351

Re: Re: many nroff directives / line

#351
From: Gary Perlman
Date: Thu, 25 Oct 1984 05:28
83 lines
3113 bytes
> [Stofzuiger]
> 
> > Is there a way to put more than one nroff directive on a single line?
> > I can't find anything in the nroff/troff manual to indicate that it is
> > impossible, but it doesn't say that it is possible, either.
> 
> That's easy: define a macro!
> 
Here is something I've been playing around with.
I call it the set macro.  All it does is process its
non-null arguments on separate lines.  They can be
macro calls, text, whatever.  Interesting, but useful?
Some examples of macros with user definable entry points
follow the definttions.

Gary Perlman/Wang Institute/Tyng Road/Tyngsboro, MA/01879/(617) 649-9731

.de $=
.\".br\"3 debugging lines commented out
.\"\\n(.$ `\\$1' `\\$2' `\\$3' `\\$4' `\\$5' `\\$6' `\\$7' `\\$8'
.\".br
.if !'\\$1'' \\$1
.if !'\\$2'' \\$2
.if !'\\$3'' \\$3
.if !'\\$4'' \\$4
.if !'\\$5'' \\$5
.if !'\\$6'' \\$6
.if !'\\$7'' \\$7
.if !'\\$8'' \\$8
.if !'\\$9'' \\$9
..
.de E\"set my favorite environment
.$= .ls1 .fi .in0 .ce0 .ftR .ps10 .vs12
.$= .po1i .ll5.5i .lt5.5i .nh .na
..
.de H\"simple heading macro
.$= .sp2v .ce10 .ftI
.$= "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
.$= .ce0 .ftR
..
.de P\"paragraphs with optional labels
.$= .sp1v .ne1i .fi .ti+.5i .ftI
.$= "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
.$= .ftR
..
.de GL\"general list header
.$= .sp1v .in0 .ftI ".nr LI 0"
.$= "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
.$= .br .in.5i .ta.5i .ftR
..
.de BL\"bullet list
.ds IL \o'+o'
.GL "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
..
.de AL\"alphanumeric list
.ds IL \\\\n(LI.
.GL "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
..
.de LI\"list item
.$= .ftI .ti0 ".nr LI +1"
\\*(IL	\c
.$= "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
.$= .ftR
..
.de LE\"list ending
.$= .in0 .ftR
..
.H "The SET Macro for Nroff" " " .ftR "Gary Perlman" "Wang Institute"
.P .ls2 "Introduction."
This macro allows very succinct specifications of format,
and it allows interspersing macro parameters with overriding values.
.ls1
.AL "Some points to consider:
.LI "Speed.
These macros should be slower than others
because they are evaluated at least twice as much.
.LI "Novelty.
They make nroff even stranger than ever.
.LI "Compactness.
In some ways,
I prefer this macro style because they follow a pattern
(entry actions, user actions, exit actions).
.LE
Technical Details
Message-ID: <20141@wivax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!dual!amd!zentec!qumix!ittvax!decvax!wivax!perlman
References: <308@digi-g.UUCP> <621@gloria.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site wivax.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!dual!amd!zentec!qumix!ittvax!decvax!wivax!perlman
From: perlman@wivax.UUCP (Gary Perlman)
Newsgroups: net.text
Subject: Re: Re: many nroff directives / line
Message-ID: <20141@wivax.UUCP>
Date: Thu, 25-Oct-84 01:28:44 EDT
Article-I.D.: wivax.20141
Posted: Thu Oct 25 01:28:44 1984
Date-Received: Sat, 27-Oct-84 04:16:17 EDT
References: <308@digi-g.UUCP> <621@gloria.UUCP>
Organization: Wang Institute, Tyngsboro, Ma.  01879
Lines: 83