1 %%% bbdb-cols.tex - multiple columns per page, multiple pages per sheet.
3 %%% Authors: Luigi Semenzato <luigi@paris.cs.berkeley.edu>
4 %%% Boris Goldowsky <boris@cs.rochester.edu>
5 %%% Copyright (C) 1993 Boris Goldowsky
6 %%% Version: 3.92; 5Jan95
10 %%% Put \input bbdb-cols.tex
11 %%% at the beginning of your TeX file.
12 %%% Then \twocol, \threecol, or \fourcol for multi-column output
13 %%% or \gridformat (4x3 grid of small credit-card-sized pages)
14 %%% or \quadformat{xsize}{ysize} for four 2-column pages per sheet.
15 %%% In any case you will need to put \endcol at the end of the
16 %%% document, before \bye.
18 %%% For instructions on using this format file with BBDB, see bbdb-print.el
19 %%% which should have come bundled with this file. The complete bbdb-print
20 %%% package is also available via anonymous ftp at:
21 %%% /cs.rochester.edu:/pub/u/boris/bbdb-print.tar.gz
23 %%% This file is part of the bbdb-print extensions to the Insidious
24 %%% Big Brother Database, which is for use with GNU Emacs.
26 %%% This program is free software; you can redistribute it and/or
27 %%% modify it under the terms of the GNU General Public License as
28 %%% published by the Free Software Foundation; either version 1, or
29 %%% (at your option) any later version.
31 %%% This program is distributed in the hope that it will be useful,
32 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
33 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34 %%% General Public License for more details.
36 %%% You should have received a copy of the GNU General Public License
37 %%% along with GNU Emacs; see the file COPYING. If not, write to
38 %%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
41 \newdimen\colshsize \colshsize=\hsize
42 \newdimen\columngutter \columngutter=.2in % space between columns
44 \newbox\columnA \newbox\columnB \newbox\columnC
49 \newbox\firstquadrant \newbox\secondquadrant
50 \newbox\thirdquadrant \newbox\fourthquadrant
51 \newbox\row \newbox\page
53 \def\columnbox{\leftline{\pagebody}}
55 \def\colsline{\hbox to \colshsize}
57 \newcount\NROW \NROW=3 % for grid format. are these really variables
58 \newcount\NCOL \NCOL=4 % that can be changed? should they be set
59 % from lisp? I'm not sure.
60 \newcount\rowindex \newcount\colindex
62 \def\onecol % for consistency---or maybe one could use it for switching back.
64 \output={\shipout\vbox{\makeheadline\colsline{\columnbox}\makefootline}
65 \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
71 \advance\hsize by -\columngutter
75 \global\setbox\columnA=\columnbox \global\let\column=B
77 \shipout\vbox{\makeheadline
78 \colsline{\box\columnA\hfil\columnbox}
80 \advancepageno \global\let\column=A
82 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
86 \vfill\supereject\if A\column \else\null\vfill\eject\fi
93 \advance\hsize -\columngutter
94 \advance\hsize -\columngutter
98 \global\setbox\columnA=\columnbox \global\let\column=B
100 \global\setbox\columnB=\columnbox \global\let\column=C
102 \shipout\vbox{\makeheadline
103 \colsline{\box\columnA\hfil\box\columnB
106 \advancepageno \global\let\column=A
108 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
113 \null\vfill\eject\null\vfill\eject
124 \advance\hsize -3\columngutter
127 \output={\if A\column
128 \global\setbox\columnA=\columnbox \global\let\column=B
130 \global\setbox\columnB=\columnbox \global\let\column=C
132 \global\setbox\columnC=\columnbox \global\let\column=D
136 \colsline{\box\columnA\hfil\box\columnB\hfil
137 \box\columnC\hfil\columnbox}
139 \advancepageno\global\let\column=A
141 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
147 \if A\column \else\null\vfill\eject\fi
148 \if B\column \else\null\vfill\eject\fi
149 \if C\column \else\null\vfill\eject\fi
162 \hsize=\colshsize \advance\hsize by -.15in \divide\hsize 2
167 \global\setbox\columnA=\columnbox \global\let\lr=R
169 \global\setbox\quadrantbox=\vbox{\colsline
170 {\box\columnA\hfil\columnbox}} \global\let\lr=L
173 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
177 \global\setbox\firstquadrant=\box\quadrantbox
178 \global\let\quadrant=B
180 \global\setbox\secondquadrant=\box\quadrantbox
181 \global\let\quadrant=C
183 \global\setbox\thirdquadrant=\box\quadrantbox
184 \global\let\quadrant=D
188 {\FULLLINE{\box\firstquadrant\hfil\box\secondquadrant}
190 \FULLLINE{\box\thirdquadrant\hfil\box\quadrantbox}}}
191 \global\let\quadrant=A
195 \def\FULLLINE{\hbox to \FULLHSIZE}
197 \def\endcol{\supereject\if R\lr \null\vfill\eject\fi}
198 } % end of quadformat
202 \def\rowspace{\vbox to 0.2in{}}
203 \def\colspace{\hbox to 0.2in{}}
208 \rowindex=0 \colindex=0
210 \setbox\row=\null \setbox\page=\null
212 \output={\global\advance\colindex by 1
213 \ifnum\colindex>\NCOL
215 \global\setbox\page=\vbox{\box\page\rowspace\box\row}
216 \global\setbox\row=\null
217 \global\advance\rowindex by 1
218 \ifnum\rowindex=\NROW
221 \global\setbox\page=\null
225 \global\setbox\row=\hbox{\box\row\colspace\columnbox}}
227 \def\columnbox{\leftline{\pagebody}}
229 \def\endcol{\vfill\supereject
230 \ifnum\colindex=1\null\vfill\eject\fi}
233 %%% bbdb-cols.tex ends here.