%
%  CokeComm program for SIPB
%
%  Andrw Marc Greene
%  <amgreene@athena.mit.edu>
%  Student Information Processing Board, MIT
%  March 1989
%
%  changed ``B.\&J.'' to ``45\rlap/c'' 
%          ``cups'' to ``5\rlap/c''
%	   ``water'' to ``15\rlap/c''
%	in two places
%  	on 7/16/96 -- Rachel Caileff <rcaileff@mit.edu>
%  changed ``Soda (45'' to ``Soda (50'' in 2 places
%       on 4/2/02 -- Cyrus Eyster <cyruse@mit.edu>
%  added comments
%       on 3/21/08 -- David Nawi <dnawi@mit.edu>
\newcount\cokesum\cokesum=0
%
% Identify the fonts we will be using:
\font\title=cmbx10 at 17.2667pt
\font\coltit=cmbx12
\font\redbullfont=cmbx7
%
% Reduce the amount of space between lines:
\baselineskip=1pt
%
% Set orientation to landscape and shift the page to make more column space per person:
\hoffset=-0.70in\hsize=10.30in   % set hsize to 11 in - 2 * (1.0 in + hoffset)
\voffset=-0.50in\vsize= 7.55in   % set vsize to 8.5 in - 2 * (1.0 in + voffset)
\special{landscape} % required for the final result to be landscape
%
%  Macros for typesetting each entry on the list
%
% Column headers:
\def\header{%
\hbox{%
\hbox to 1.5in{\coltit{Name}\hfil}%
\hbox to 0.5in{\hfil\coltit{cans}}%
\hbox to 0.7in{\hfil\coltit{Bal.}\hfil}%
\quad%
\hbox to 2.0in{\hfil\coltit{Soda (50\rlap/c)}\hfil}%
\quad\quad%
\hbox to 1.0in{\hfil\coltit{Jones (75\rlap/c)}\hfil}%
\quad\quad%
\hbox to 1.0in{\hfil\coltit{Juice (60\rlap/c)}\hfil}%
\quad\quad%
\hbox to 2.0in{\hfil\coltit{Candy \& Snacks (60\rlap/c)}\hfil}%
\quad\quad%
}}
%
% Complete row for each person:
% params: Name, username, cans, balance, membership (not used)
\def\person#1#2#3#4#5{
#1 & \quad & \$ #4 &&& \cr
\tt{#2} &&&&& \cr
\noalign{\vskip 2pt\hrule\vskip 2pt}
\noalign{\penalty -1000}}
%
% Block of bubbles 5 wide and 2 high (0.5in wide):
\newbox\tenbubbles
\setbox\tenbubbles=\hbox to 0.5in{\hfil$^{\cal{O}\cal{O}\cal{O}\cal{O}\cal{O}}_{\cal{O}\cal{O}\cal{O}\cal{O}\cal{O}}$\hfil}
%\setbox\tenbubbles=\hbox to 0.5in{\hfil$^{\mathcal{O}\mathcal{O}\mathcal{O}\mathcal{O}\mathcal{O}}_{\mathcal{O}\mathcal{O}\mathcal{O}\mathcal{O}\mathcal{O}}$\hfil}
\def\ten{\copy\tenbubbles}
%
% Set of bubble blocks to match column titles:
\newbox\bubblebox
\setbox\bubblebox=\hbox{\ten\ten\ten\ten\quad\quad\ten\ten\ten\quad\quad\ten\ten\ten\ten\quad\quad\ten\ten}
\def\bubbles{\copy\bubblebox}
%
% Rewrite footline-building macro to eliminate the double line that is normally added:
\def\makefootline{\baselineskip=0pt\line{\the\footline}}
%
% Body of document
%
\headline={\vbox{\hbox{\centerline{\title CokeComm Sheet, Page \folio}}\vskip 10pt\header\hrule height 1.0pt}}
\footline={\header\hfil}
%
% adjust the top edge of the page to allow for extra-large headline
\topskip 0.4in
%
\tabskip=0pt
\halign{
\hbox to 1.5in{#\hfil} & \hbox to 0.5in{\hfil#} & \hbox to 0.7in{\hfil#\quad} &
#\ten\ten\ten\ten\tabskip=2em & #\ten\ten\quad\quad\ten\ten & #\ten\ten\ten\ten\tabskip=0pt \cr
% TODO: check that the file exists and skip it if it doesn't
% Note:  this is a file with a list of \person entries
\input sipb.data.tex
% TODO: add loop to fill last page with empty rows
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}
\person{}{}{0}{0.00}{non-member}}
\bye
