tim@unc.UUCP (06/29/83)
For a few weeks now, I have been using a hand-made set of nroff macros to do most of my news formatting. Formerly, I had used the -me macros, but the problem with them is that they take an annoyingly long time to load, and provide many features that I neither want nor need. All that I really need is a paragraphing macro, some indentation and exdentation macros for quoting other people's articles, and an automatic signature signer. What I have finally settled on includes two source files and one vi alias. The two source files will be referred to herein as "newsmacs" and "signature"; you will have to substitute a full pathname for these in the vi alias. The vi alias, which should appear in your EXINIT variable or .exrc file, is as follows: map g 1G!Gnroff newsmacs - signature^V^V^V^M (Note: the ^V's and ^M represent control characters you should type in. Do not use this line directly in your file; it won't work.) When you type `g' in vi, nroff will be run over the entire file, and the file replaced by the results of the nroffing. (Of course, only the vi buffer, not the actual file, is modified.) Check it out to see everything is right; if not, type `u' (undo) to get back to the original. If you aren't using vi, then you'll have to work out your own version. This shouldn't be too hard in EMACS, but other editors may be a pain. You may want to edit a temporary file and run nroff over it from the UNIX shell. The paragraphing macro is ".P". A line consisting only of ".P" in the first column should precede each paragraph. When quoting someone else at length, use the ".I" macro to cause indentation; when you are finished, use the ".O" macro to end the indentation. The ".I" and ".O" macros also cause a paragraph to start. They can be nested arbitrarily, and to return from two levels of indentation you must have two lines with the ".O" macro. Note that all three macros should be the only thing on their line. The newsmacs file also contains some constants you may wish to change. For instance, I disable hyphenation; if you don't want to, remove the ".nh" line. Without further ado, everything from the %%BEGIN%% to the %%END%% line, except those lines themselves, is the newsmacs file. I expect you to save this article and manually extract the newsmacs file into wherever you want to put it. %%BEGIN%% .\" Ultra-simple macros for news and mail .\" Paragraph macro .P .de P .sp 1 .ti +4 .. .\" Indentation macro .IN; used to start quotes; .I (below) more common .de IN .in +8 .ll -8 .. .\" Exdentation macro .OU; used to end quotes; .O (below) more common .de OU .in -8 .ll +8 .. .\" Indent and start paragraph with .I macro .de I .IN .P .. .\" Exdent and start paragraph with .O macro .de O .OU .P .. .\" Finally, various conveniences and constants .ll 70 .pl 1 .na .nh %%END%% And here is the signature file. Of course, you will have to change this for your own purposes. Again, it is enclosed within %%BEGIN%% and %%END%% lines. %%BEGIN%% .\" nroff signature file .sp 1 .in 0 .nf ====================================== The overworked keyboard of Tim Maroney .sp 1 duke!unc!tim (USENET) tim.unc@udel-relay (ARPA) The University of North Carolina at Chapel Hill %%END%% Well, I hope you enjoy these. They have been a great convenience to me. BE SURE TO CHANGE THE SIGNATURE FILE!!! ====================================== The overworked keyboard of Tim Maroney duke!unc!tim (USENET) tim.unc@udel-relay (ARPA) The University of North Carolina at Chapel Hill