Article View: comp.text
Article #4328Re: troff question
From: hapke
Date: Fri, 15 Jan 1988 17:35
Date: Fri, 15 Jan 1988 17:35
26 lines
1547 bytes
1547 bytes
First of all, you shouldn't need to worry about spaces. According to
Ossano's "NROFF/TROFF User's Manual", section 7.3, "the argument separator
[for macro arguments] is the space character, ..." Extra spaces seem to be
ignored in my tests.
Frankly, I've never seen any macro set that checks for the presence on tabs,
etc. in the input. (I've written and maintained custome macro sets at this
site, and I'm familiar with -ms, -mm, -man, and -me). Given the clumsy nature
of troff's syntax checking, what you want is probably more effort than it's
worth. If the macro should have only two or zero arguments, you could use
this code to check that it has the correct number:
.de XY
.\" If the number of args (.$) is either 2 or(:) 0, things are OK
.ie (\\n(.$=2):(\\n(.$=0) \{\
.\" body of macro
.\}
.el .tm Input error; .XY takes only 2 or 0 arguments
..
This is more error checking that most macros provided. Getting the correct
characters in the arguments would be up to the user.
Warren Hapke, Gould CSD-Urbana
ihnp4!uiucdcs!ccvaxa!hapke
Technical Details
Message-ID:
<29400005@ccvaxa>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!ucbcad!pasteur!ames!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!hapkeReferences:
<1265@cg-atla.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!ucbcad!pasteur!ames!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!ccvaxa!hapke From: hapke@ccvaxa.UUCP Newsgroups: comp.text Subject: Re: troff question Message-ID: <29400005@ccvaxa> Date: 15 Jan 88 17:35:00 GMT References: <1265@cg-atla.UUCP> Lines: 26 Nf-ID: #R:cg-atla.UUCP:1265:ccvaxa:29400005:000:1059 Nf-From: ccvaxa.UUCP!hapke Jan 15 11:35:00 1988