colonel@gloria.UUCP (George Sicherman) (10/22/84)
[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! .de MY .directive 1 .directive 2 .directive 3 .. ... .MY ... .MY This is the logical way to do it. -- Col. G. L. Sicherman ...seismo!rochester!rocksanne!rocksvax!sunybcs!gloria!colonel
perlman@wivax.UUCP (Gary Perlman) (10/25/84)
> [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