[comp.text] troff 3 columns: summary and thanks

ray@vantage.UUCP (Ray Liere) (11/11/90)

I posted a request to the net for suggestions on how to get 3 column output
using the -mm macros with troff:
>>  I have been trying (unsuccessfully so far) to write a troff macro that
>>  will do 3 column output on a page. I started with .2C (2 column output)
>>  from the -mm library.
>>
>>  I have developed a nice set of macros that do unusual things to text ...
>>  but not what I want to do!
>>
>>  Does anyone have a .3C that they would be willing to share?

First, I want to thank those that offered assistance and ideas:
	Bruce Lilly -- blilly!balilly!bruce@sonyd1.Broadcast.Sony.COM
	Liam R. E. Quin -- lee@sq.com
	Phil Hughes -- uunet!pilchuck!ssc!fyl or attmail!ssc!fyl
	Wolfgang Denk -- wd@pcsbst.pcs.[COM From rest of world; DE From Europe]
	Markku Sakkinen -- sakkinen@tukki.jyu.fi

Here is a summary of the suggested solutions:
- use .MC in the -ms macro package ("MC" == Multiple Columns)
- write my own
- use .2c in the -me macros package


My reason for wanting to stay within -mm was that the document had already
been set up using lots of -mm macros and I did not want to convert it.

I did try writing my own, but troff macro is not my area of expertise and
diddling with existing 2 column code from -mm to try to get it to do
3 columns made me lose hair that I can not afford to lose.

The obvious solution of "lifting" a macro from some other library and
using it with -mm died a fiery death -- there are zillions of registers
and strings and so forth assumed to be globally set by each macro in
a particular macro library ... and of course the different libraries
are not compatible ... and each macro invokes at least 47 others.
(I should have seen that one coming).

Also, macro libraries are notoriously uncommented.

I did find a reference of interest -- in "UNIX Nroff/Troff A User's Guide"
by Roddy (p.100-101).

What I did, which worked _for me_ (i.e., is NOT a general solution) is
to instruct that both -mm and -ms macro packages be loaded and then
I used both -mm and -ms macros in the same document. Yes ... not the
best solution ... and I did have to scan the document carefully to see
that everything was there and where it should be. I found empirically
that I got better results if I loaded -ms and then -mm. While troff runs,
I do get some weird messages at the terminal ("digit expected, <newline>
seen instead" and "no font mounted at position 0") -- but I get correct output
and that was in my situation the most important consideration. I am almost
embarrassed to admit all of this, as I am very big on "doing things the proper
way".

The .MC macro (which is what I used) will do any number of columns -- which
is neat. You tell it how wide you want each column and it computes how many
columns of text to put on the page. If you don't like the width of
the space between the columns that it computes, you can do a degree adjust it
by adjusting the column width that you give it. But if it is way different
from what you want, then you will find that it will (for example) add another
column before it gives you what it considers to be too much whit space.
One cound of course tweak the macro -- but see "anti-diddle" cautions above.

My thanks again for the help that was given by the above-mentioned people.

Ray Liere
Vantage Consulting and Research Corporation
voice: (503)657-7294
uucp: uunet!nwnexus.WA.COM!vantage!ray
       -or-
      uunet!nwnexus!vantage!ray
       -or-
      hplabs!hpubvwa!hpupora!vantage!ray
Internet: ray%vantage@nwnexus.WA.COM