%
% BEGIN PARAMETERS
%
%===========================================================
\hsize=16cm%\hoffset=-2.54cm
\vsize=24cm\voffset=-1.54cm

\def\height{4cm}		% heigth of a badge
\def\width{7.5cm}		% width of a badge
%===========================================================
%
% END PARAMETERS
%

\parskip=0pt
\baselineskip=0pt
\lineskip=0pt
\nopagenumbers

\font\RC=RC scaled 483				% take your own logo here
\font\tue=tue scaled 403			% take your own logo here
\font\namefont=cmssbx10 scaled\magstep2
\font\addressfont=cmss10 scaled\magstep1

\def\hidehrule#1#2{\kern-#1%
	\hrule height#1 depth #2 \kern-#2 }
\def\hidevrule#1#2{\kern-#1{\dimen0=#1
	\advance\dimen0 by#2\vrule width\dimen0}\kern-#2 }
\def\makeblankbox#1#2{\hbox{\lower\dp0\vbox{\hidehrule{#1}{#2}%
	\kern\ht0\hidehrule{#1}{#2}\kern-\ht0%
	\kern-#1 % overlap the rules at the corners
	\hbox to \wd0{\hidevrule{#1}{#2}%
		\raise\ht0\vbox to #1{}% set the vrule heigth
		\lower\dp0\vtop to #1{}% set the vrule depth
		\hfil\hidevrule{#2}{#1}}%
	\kern-#1\hidehrule{#2}{#1}
	}}}
	
\def\makelightbox{\makeblankbox{.2pt}{.2pt}}

\def\nullbox#1#2#3{\setbox0=\null
	\ht0=#1 \dp0=#2 \wd0=#3 \copy0\kern-\wd0\makelightbox}	

\newdimen\x \newdimen\y
\def\put(#1,#2,#3){\setbox0=\hbox{#3}%
	\x=#1\y=#2 \advance\y by\ht0	% put reference point of box at (x,y)
	\vbox to 0pt{\kern-\y
	\hbox{\kern\x\copy0\kern-\wd0\makelightbox}\vss}
	\nointerlineskip}


\newcount\cnt \cnt=0
\newdimen\X \newdimen\Y \X=0cm \Y=0cm

\def\badge#1#2{
   \advance\cnt by1
   \ifodd\cnt\X=0cm\advance\Y by-\height
      \ifnum\Y<-\vsize\eject\cnt=1\X=0cm\Y=-\height\fi
      \else\advance\X by\width
   \fi
   \put(\X,\Y,% don't leave this percent sign!
   	\vbox to \height{
		\kern.5cm
		{\namefont\hbox to\width{\hfill#1\hfill}}
		\vfil		% next line is site dependant !!!!!!
		\hbox to \width{\kern.5cm{\tue tue}\hfill{\RC RC}\kern.5cm}
		\vfil		% above line is site dependant !!!!!!
		{\addressfont\hbox to\width{\hfill#2\hfill}}
		\kern.5cm%
	})
}

\newread\addressfile
\newif\ifGoOn	\GoOntrue

\openin\addressfile=addresses
\ifeof\addressfile\message{Cannot open addresses}\end\fi

\read\addressfile to \text \let\name=\text
\loop
   \read\addressfile to \text \let\inst=\text
   \immediate\write16{Badge: \name \inst}
   \badge{\name}{\inst}
   \read\addressfile to \text \let\name=\text
   \ifeof\addressfile\GoOnfalse\fi
   \ifGoOn
\repeat

\closein\addressfile
\bye
