summaryrefslogtreecommitdiff
path: root/tex/bbdb-print.tex
blob: 25c2f26c85546f298ec7f8efb89d79eb15c47b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
%%% bbdb-print.tex - for formatting address lists.

%%% Authors: Luigi Semenzato <luigi@paris.cs.berkeley.edu>
%%%          Boris Goldowsky <boris@cs.rochester.edu>
%%% Copyright (C) 1993 Boris Goldowsky
%%% Version: 3.92; 5Jan95

%%% For instructions on using this format file with BBDB, see bbdb-print.el
%%% which should have come bundled with this file.  The complete bbdb-print
%%% package is also available via anonymous ftp at:
%%% /cs.rochester.edu:/pub/u/boris/bbdb-print.tar.gz

%%% This file is part of the bbdb-print extensions to the Insidious
%%% Big Brother Database, which is for use with GNU Emacs.
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
%%% published by the Free Software Foundation; either version 1, or
%%% (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will be useful,
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
%%% General Public License for more details.
%%%
%%% You should have received a copy of the GNU General Public License
%%% along with GNU Emacs; see the file COPYING.  If not, write to
%%% the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

%%% The address-list file should look something like this:

%%% \input file          % this format file's filename
%%% \setsize6            % point size of type to use
%%%                      % or \setpssize6 to use PostScript fonts. (optional)
%%% \setseparator3       % which style of separators, 0-7
%%%
%%% \separator{A}        % include a separator here
%%%
%%% \beginrecord
%%% \name{A. Name}
%%% \phone{location: (xxx) xxx-xxxx}
%%% \address{1234 Main Street\\
%%% Anytown, XX 00000\\}
%%% \note{note name}{note text}
%%% \notes{blah blah}
%%% \endrecord
%%% 
%%% \endaddresses
%%% \bye

\raggedright
\tolerance=10000
\hbadness=10000
\parskip 0pt
\parindent=0pt  % was 10pt
\footline{\hfil}

%%%
%%% Fonts
%%%

\def\setsize#1{
  \font\rm=ecrm#1
  \font\bf=ecbx#1
  \font\it=\ifnum #1=6 ecti7 \else ecti#1 \fi
  \font\tt=ectt#1
  \font\bigbf=ecbx10 scaled \magstep3
  \rm
  \baselineskip=#1pt
  \ifnum #1>9 \advance\baselineskip by 1pt \fi
}

\def\setpssize#1{
  \font\rm=ptmr at #1pt
  \font\bf=ptmb at #1pt
  \font\it=ptmri at #1pt
  \font\tt=pcrr at #1pt
  {\dimen0=#1pt\global\font\bigbf=ptmb at 1.8\dimen0}
  \rm
  \baselineskip=#1pt
}

%%%
%%% Define separator types
%%% 

\def\setseparator#1{
  \ifnum #1=1
    \def\separator##1{\hrule\smallskip\mark{##1}}
  \else \ifnum #1=2
    \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip
            \centerline{\bf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule
            \mark{##1}}}
  \else \ifnum #1=3
    \def\separator##1{\hbox{\vrule\hskip -0.4pt\vbox{\hrule\smallskip
            \centerline{\bigbf{##1}}\smallskip\hrule}\hskip -0.4pt\vrule}
            \medskip\mark{##1}}
  \else \ifnum #1=4
    \def\separator##1{\smallskip\centerline{\bigbf{##1}}\medskip\mark{##1}}
  \else \ifnum #1=5
    \def\separator##1{\hrule\smallskip
            \centerline{\bigbf{##1}}\smallskip\hrule\medskip\mark{##1}}
  \else \ifnum #1=6
    \def\cute{$\sya\syb\syc\syd$}
    \def\revcute{$\syd\syc\syb\sya$}
    \let\sya=\heartsuit\let\syb=\spadesuit
      \let\syc\diamondsuit\let\syd=\clubsuit
    \def\cycle{\let\tmp=\sya\let\sya=\syb
                   \let\syb=\syc\let\syc=\syd\let\syd=\tmp}
    \def\separator##1{\smallskip
        \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil}
        \cycle\medskip\mark{##1}}
  \else \ifnum #1=7
    \def\cute{$\sya\syb\syc\syd$}
    \def\revcute{$\syd\syc\syb\sya$}
    \let\sya=\heartsuit\let\syb=\spadesuit
    \let\syc=\diamondsuit\let\syd=\clubsuit
    \def\cycle{\let\tmp=\sya\let\sya=\syb\let\syb=\syc\let\syc=\syd
               \let\syd=\tmp}
    \def\separator##1{\hbox{\vrule\vbox{\hrule\smallskip
            \hbox to \hsize{\hfil\cute\hfil\bigbf{##1}\hfil\revcute\hfil}
            \smallskip\hrule}\vrule}\medskip\cycle\mark{##1}}
  \else
    \def\separator##1{\mark{##1}}
  \fi\fi\fi\fi\fi\fi\fi
} % end setseparator

%%%
%%% Macros for formatting the entries.
%%%

\def\beginaddresses{}

\def\endaddresses{
  \bigskip\hrule\smallskip
  \noindent {\bf Printed \today}\vfill\endcol}

\def\beginrecord{\bigbreak}

\def\endrecord{\bigbreak}

\def\\{\par}

\def\dots{\leaders\hbox to 0.6em{\hss.\hss}}

\def\firstline#1#2{% the name and (maybe) the first phone number.
  \hyphenpenalty=10000\rightskip=0pt plus 1fil
  \noindent{\bf #1}\dotfill\penalty-1\hbox{}\dotfill{#2}\\
}

\def\name#1{\firstline{#1}{}} % for backwards compatibility

\def\comp#1{#1\\}

\def\phone#1{\hfill#1\\}

\def\email#1{\smallbreak{\tt#1}\\}

\def\address#1{\smallbreak#1\smallbreak}

\def\note#1#2{{\smallbreak\leftskip=2em\parindent=-1em
  \noindent\hskip-\leftskip{\it#1:  } #2\\ }}

\def\notes#1{\smallbreak{\it(#1)}\\ }

\def\today{\number\day\space
        \ifcase\month\or Jan\or Feb\or Mar\or Apr \or May\or June\or
        Jul\or Aug\or Sept\or Oct\or Nov\or Dec\fi
        \space\number\year}

%%% bbdb-print.tex ends here.