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