Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!uunet!mcsun!ukc!tcdcs!dce.ie!em From: em@dce.ie (Eamonn McManus) Newsgroups: comp.text.tex Subject: Re: TeX Phonelist Program. Message-ID: Date: 11 Feb 91 13:57:21 GMT References: <1991Feb10.143323.1817@arnor.uucp> Organization: Datacode Communications Ltd, Dublin, Ireland Lines: 43 Here's a hacky set of macros that I use to typeset short (one or two pages) phonelists. The input file has three fields, separated by tabs. If the first field is empty that line is grouped with the line above; otherwise a little extra space is introduced. If the middle field is to be empty, a ~ or other filler must be employed there. Comments begin with #. \' is redefined so that if the accented letter is an i, a dotless version is used; this is probably only of use in Ireland. Here's a typical entry: \'Eamonn McManus 6 Tivoli Tce Sth, D\'un Laoire 807230 Datacode, Pottery Rd 840660 I've a separate specialised grep that prints out an entire entry when any one of its lines matches a keyword. ____ , \ / Eamonn \/ % phone.tex - format the file `phonelist' % By \'Eamonn McManus, 1989 sometime. This file is not copyrighted. \nopagenumbers \sfcode`.=1000 \vsize=9.5in \catcode9=\active \catcode13=\active \endlinechar=-1 % For now. \def^^I{&\skiptabs} \def\skiptabs#1{\ifx^^I#1\let\next\skiptabs \else \let\next#1\fi \next} \let\fada=\' \def\'#1{\expandafter\fada \if#1i\i\else#1\fi} \def\preamble{\check##\relax\strut\hfil\qquad & ##\hfil\qquad & ##\hfil} \def\check#1{\if \relax #1\else \vrule height 3ex width 0ex #1\fi} \catcode`\#=\catcode`\% # Standard comment character \catcode`\&=12 \global\catcode`\$=12 \global\catcode`\%=12 # \endlinechar=13 \let^^M=\crcr # # # We eat the entire phonelist as a \halign. This is only practical for # relatively small lists. Longer ones should either use fixed tab positions # or do very tricky things with output routines and two-pass scanning in # order to arrange for every page to be its own \halign. \halign\expandafter{\preamble \cr # \input phonelist } \bye