1 % bbdb.sty --- basic LaTeX style for TeXing BBDB
3 % Copyright (C) 2017 Free Software Foundation, Inc.
5 % This file is part of the Insidious Big Brother Database (aka BBDB),
7 % BBDB is free software: you can redistribute it and/or modify
8 % it under the terms of the GNU General Public License as published by
9 % the Free Software Foundation, either version 3 of the License, or
10 % (at your option) any later version.
12 % BBDB is distributed in the hope that it will be useful,
13 % but WITHOUT ANY WARRANTY; without even the implied warranty of
14 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 % GNU General Public License for more details.
17 % You should have received a copy of the GNU General Public License
18 % along with BBDB. If not, see <http://www.gnu.org/licenses/>.
22 % This file defines a basic LaTeX style for TeXing BBDB.
24 \def\bbdb@name#1#2{\textbf{#2, #1}}
25 \def\bbdb@organization#1{#1}
26 \def\bbdb@affix#1{\emph{affix:} #1}
27 \def\bbdb@aka#1{\emph{aka:} #1}
28 \def\bbdb@phone#1#2{\emph{#1:} #2}
29 \def\bbdb@mail#1#2{\ifx\href\undefined
32 \href{mailto:#1}{\texttt{#2}}%
34 \def\bbdb@address#1#2{\emph{#1:} #2}
35 \def\bbdb@xfield#1#2{\emph{#1:} #2}
37 % \def\bbdb@separator#1{\hline}
38 \def\bbdb@separator#1{\\\hline
39 \multicolumn{\LT@cols}{@{}c@{}}{\hrulefill\ #1\rule{0pt}{2.2ex}\ \hrulefill}\\}
41 \RequirePackage{longtable}
42 \newenvironment{bbdb}[1]{%
44 \let\organization\bbdb@organization
49 \let\address\bbdb@address
50 \let\xfield\bbdb@xfield
51 \let\bbdbseparator\bbdb@separator
52 \begin{longtable}[l]{@{}#1@{}}}%
53 {\\ \hline \multicolumn{\LT@cols}{c}{Printed \today}\\ \hline\end{longtable}}
55 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 \def\bbdbrecord@name#1#2{{\raggedright\textbf{#2, #1}\dotfill\par}}
58 \def\bbdbrecord@organization#1{#1\par}
59 \def\bbdbrecord@affix#1{\bbdbrecord@par{\emph{affix:} #1}}
60 \def\bbdbrecord@aka#1{\bbdbrecord@par{\emph{aka:} #1}}
61 \def\bbdbrecord@phone#1#2{\hspace*{\fill}\emph{#1:} #2\par}
62 \def\bbdbrecord@mail#1#2{\ifx\href\undefined
65 \href{mailto:#1}{\texttt{#2}}%
67 \def\bbdbrecord@par#1{{\leftskip 1em\parindent -\leftskip#1\par}}
68 \def\bbdbrecord@address#1#2{\bbdbrecord@par{\emph{#1:} #2}}
69 \def\bbdbrecord@xfield#1#2{\bbdbrecord@par{\emph{#1:} #2}}
71 \newenvironment{bbdbrecord}{%
75 \let\name\bbdbrecord@name
76 \let\organization\bbdbrecord@organization
77 \let\affix\bbdbrecord@affix
78 \let\aka\bbdbrecord@aka
79 \let\phone\bbdbrecord@phone
80 \let\mail\bbdbrecord@mail
81 \let\address\bbdbrecord@address
82 \let\xfield\bbdbrecord@xfield}{\medbreak}
84 \newcommand*{\bbdbseparator}[1]{\vspace{3ex}\noindent
85 \fbox{\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}%
86 {\centering\textbf{#1}}}%
89 % \endinput % Fails when inlining this file.