Initial Commit
[packages] / xemacs-packages / bbdb / tex / bbdb-print.tex
1 %%% bbdb-print.tex - for formatting address lists.
2
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
7
8 %%% For instructions on using this format file with BBDB, see bbdb-print.el
9 %%% which should have come bundled with this file.  The complete bbdb-print
10 %%% package is also available via anonymous ftp at:
11 %%% /cs.rochester.edu:/pub/u/boris/bbdb-print.tar.gz
12
13 %%% This file is part of the bbdb-print extensions to the Insidious
14 %%% Big Brother Database, which is for use with GNU Emacs.
15 %%%
16 %%% This program is free software; you can redistribute it and/or
17 %%% modify it under the terms of the GNU General Public License as
18 %%% published by the Free Software Foundation; either version 1, or
19 %%% (at your option) any later version.
20 %%%
21 %%% This program is distributed in the hope that it will be useful,
22 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
23 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24 %%% General Public License for more details.
25 %%%
26 %%% You should have received a copy of the GNU General Public License
27 %%% along with GNU Emacs; see the file COPYING.  If not, write to
28 %%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
29
30 %%% The address-list file should look something like this:
31
32 %%% \input file          % this format file's filename
33 %%% \setsize{6}          % point size of type to use
34 %%%                      % or \setpssize{6} to use PostScript fonts. (optional)
35 %%% \setseparator{3}     % which style of separators, 0-7
36 %%%
37 %%% \separator{A}        % include a separator here
38 %%%
39 %%% \beginrecord         % and start a record
40 %%% \name{A. Name}
41 %%% \phone{location: (xxx) xxx-xxxx}
42 %%% \address{1234 Main Street\\
43 %%% Anytown, XX 00000\\}
44 %%% \note{note name}{note text}
45 %%% \notes{blah blah}
46 %%% \endrecord
47 %%% 
48 %%% \endaddresses        % done
49 %%% \bye
50
51 \raggedright
52 \tolerance=10000
53 \hbadness=10000
54 \parskip 0pt
55 \parindent=0pt
56 \footline{\hfil}
57
58 %%%
59 %%% Fonts
60 %%%
61
62 \def\setsize#1{
63   \font\rm=ecrm#1
64   \font\bf=ecbx#1
65   \font\it=\ifnum #1=6 ecti7 \else ecti#1 \fi
66   \font\tt=ectt#1
67   \font\bigbf=ecbx#1 scaled \magstep3
68   \rm
69   \baselineskip=#1pt
70   \ifnum #1>9 \advance\baselineskip by 1pt \fi
71 }
72
73 \def\setpssize#1{
74   \font\rm=ptmr at #1pt
75   \font\bf=ptmb at #1pt
76   \font\it=ptmri at #1pt
77   \font\tt=pcrr at #1pt
78   {\dimen0=#1pt\global\font\bigbf=ptmb at 1.8\dimen0}
79   \rm
80   \baselineskip=#1pt
81 }
82
83 %%%
84 %%% Define separator types
85 %%% 
86
87 \def\setseparator#1{
88   \ifnum #1=1
89     \def\separator##1{\hrule\smallskip\mark{##1}}
90   \else \ifnum #1=2
91     \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip
92             \centerline{\bf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule
93             \mark{##1}}}
94   \else \ifnum #1=3
95     \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip
96             \centerline{\bigbf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule}
97             \medskip\mark{##1}}
98   \else \ifnum #1=4
99     \def\separator##1{\smallskip\centerline{\bigbf{##1}}\medskip\mark{##1}}
100   \else \ifnum #1=5
101     \def\separator##1{\hrule\smallskip
102             \centerline{\bigbf{##1}}\smallskip\hrule\medskip\mark{##1}}
103   \else \ifnum #1=6
104     \def\cute{$\sya\syb\syc\syd$}
105     \def\revcute{$\syd\syc\syb\sya$}
106     \let\sya=\heartsuit\let\syb=\spadesuit
107       \let\syc\diamondsuit\let\syd=\clubsuit
108     \def\cycle{\let\tmp=\sya\let\sya=\syb
109                    \let\syb=\syc\let\syc=\syd\let\syd=\tmp}
110     \def\separator##1{\smallskip
111         \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil}
112         \cycle\medskip\mark{##1}}
113   \else \ifnum #1=7
114     \def\cute{$\sya\syb\syc\syd$}
115     \def\revcute{$\syd\syc\syb\sya$}
116     \let\sya=\heartsuit\let\syb=\spadesuit
117     \let\syc=\diamondsuit\let\syd=\clubsuit
118     \def\cycle{\let\tmp=\sya\let\sya=\syb\let\syb=\syc\let\syc=\syd
119                \let\syd=\tmp}
120     \def\separator##1{\hbox{\vrule\vbox{\hrule\smallskip
121             \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil}
122             \smallskip\hrule}\vrule}\medskip\cycle\mark{##1}}
123   \else
124     \def\separator##1{\mark{##1}}
125   \fi\fi\fi\fi\fi\fi\fi
126 } % end setseparator
127
128 %%%
129 %%% Macros for formatting the entries.
130 %%%
131
132 \def\beginaddresses{}
133
134 \def\endaddresses{
135   \bigskip\hrule\smallskip
136   \noindent {\bf Printed \today}\vfill\endcol}
137
138 \def\beginrecord{\bigbreak}
139
140 \def\endrecord{\bigbreak}
141
142 \def\\{\par}
143
144 \def\dots{\leaders\hbox to 0.6em{\hss.\hss}}
145
146 \def\firstline#1#2{% the name and (maybe) the first phone number.
147   \hyphenpenalty=10000\rightskip=0pt plus 1fil
148   \noindent{\bf #1}\dotfill\penalty-1\hbox{}\dotfill{#2}\\
149 }
150
151 \def\name#1{\firstline{#1}{}} % for backwards compatibility
152
153 \def\comp#1{#1\\}
154
155 \def\phone#1{\hfill#1\\}
156
157 \def\email#1{\smallbreak{\tt#1}\\}
158
159 \def\address#1{\smallbreak#1\smallbreak}
160
161 \def\note#1#2{{\smallbreak\leftskip=2em\parindent=-1em
162   \noindent\hskip-\leftskip{\it#1:  } #2\\ }}
163
164 \def\notes#1{\smallbreak{\it(#1)}\\ }
165
166 \def\today{\number\day\space
167         \ifcase\month\or Jan\or Feb\or Mar\or Apr \or May\or June\or
168         Jul\or Aug\or Sept\or Oct\or Nov\or Dec\fi
169         \space\number\year}
170
171 %%% bbdb-print.tex ends here.