Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!labrador.cs.tufts.edu!not-for-mail From: "Aaron W. Hsu" Newsgroups: comp.programming.literate Subject: Re: [?] Two Column Output in CWEB Date: Sun, 2 Oct 2011 23:57:12 -0400 (EDT) Organization: Indiana University Lines: 43 Sender: nr@labrador.cs.tufts.edu Approved: Litprog auto-moderator Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net R4gZ9rVDBvLJO3CMS5aaBC+kQLatJ8/UUV69fZ5BQIc6cRJJGNVkmO+oUb8jhL6ii8Xa9Bij5ZStLk5BgJAvyA== NNTP-Posting-Date: Mon, 3 Oct 2011 03:57:13 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="jyvnSgBI3GgJFWbuRLKgR65dovk5FqOhQ0TjYCsOIHA5jrw/dTm/Ez0dWjIw5sijp9jIQaA8BVVn6ELyXvvSEa3evbvR8V8HN5eU1hJgEGcQ7IYXR2p+X3RQcDtsO8/e"; mail-complaints-to="abuse@albasani.net" Errors-To: /dev/null Cancel-Lock: sha1:gwO3d3QWn1Z8zLp751GI1/FogTg= Xref: x330-a1.tempe.blueboxinc.net comp.programming.literate:21 On Sun, 02 Oct 2011 17:57:05 -0400, Robert Hartmann wrote: > Am 01.10.2011 21:32, schrieb Aaron W. Hsu: >> On Fri, 30 Sep 2011 21:47:12 -0400, Aaron W. Hsu >> wrote: >> >>> Does anyone here know how to get two column output in CWEB? >> >> I figured out that I can extract elements from the cwebmac.tex file to >> accomplish what I want, since the index is two columns. With some >> adjustment to that macro, I am able to get the effect for which I was >> hoping. > > Can you please write your your agjustments? Here's what I put at the top of my web: %%% I want two column output. This is taken from chezwebmac.tex. %%% See the license information on that file. % \def\page{\box255 } \normalbottom \output{\ifpagesaved\normaloutput{\box\sbox}\lheader\rheader\fi \global\setbox\sbox=\page \global\pagesavedtrue} \pagesavedfalse \eject % eject the page-so-far and predecessors \setbox\sbox\vbox{\unvbox\sbox} % take it out of its box \vsize=\pageheight \advance\vsize by -\ht\sbox % the remaining height \hsize=.5\pagewidth \advance\hsize by -10pt % column width for the index (20pt between cols) \parfillskip 0pt plus .6\hsize % try to avoid almost empty lines \def\lr{L} % this tells whether the left or right column is next \output{\if L\lr\global\setbox\lbox=\page \gdef\lr{R} \else\normaloutput{\vbox to\pageheight{\box\sbox\vss \hbox to\pagewidth{\box\lbox\hfil\page}}}\lheader\rheader \global\vsize\pageheight\gdef\lr{L}\global\pagesavedfalse\fi} %\parskip 0pt plus .5pt %\rm \rightskip0pt plus 2.5em \tolerance 10000 \let\*=\lapstar Hope that is useful to someone! Aaron W. Hsu -- Programming is just another word for the lost Art of Thinking.