Groups | Search | Server Info | Login | Register


Groups > comp.programming.literate > #21

Re: [?] Two Column Output in CWEB

From "Aaron W. Hsu" <arcfide@sacrideo.us>
Newsgroups comp.programming.literate
Subject Re: [?] Two Column Output in CWEB
Date 2011-10-02 23:57 -0400
Organization Indiana University
Message-ID <j6bbqo$ci$1@labrador.cs.tufts.edu> (permalink)
References (2 earlier) <sfid-H-20111001-153204-+35.15-1@multi.osbf.lua> <j67prl$j2u$1@labrador.cs.tufts.edu> <sfid-H-20111002-175704-+45.48-1@multi.osbf.lua> <j6amnh$jhe$1@labrador.cs.tufts.edu> <sfid-H-20111002-235703-+44.09-1@multi.osbf.lua>

Show all headers | View raw


On Sun, 02 Oct 2011 17:57:05 -0400, Robert Hartmann  
<Robert_Hartmann@gmx.net> wrote:

> Am 01.10.2011 21:32, schrieb Aaron W. Hsu:
>> On Fri, 30 Sep 2011 21:47:12 -0400, Aaron W. Hsu <arcfide@sacrideo.us>
>> 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.

Back to comp.programming.literate | Previous | NextPrevious in thread | Find similar


Thread

[?] Two Column Output in CWEB "Aaron W. Hsu" <arcfide@sacrideo.us> - 2011-09-30 21:47 -0400
  Re: [?] Two Column Output in CWEB "Aaron W. Hsu" <arcfide@sacrideo.us> - 2011-10-01 15:32 -0400
    Re: [?] Two Column Output in CWEB Robert Hartmann <Robert_Hartmann@gmx.net> - 2011-10-02 17:57 -0400
      Re: [?] Two Column Output in CWEB "Aaron W. Hsu" <arcfide@sacrideo.us> - 2011-10-02 23:57 -0400

csiph-web