[emacs] manually add bbdb into lisp/bbdb/
[~bandali/configs] / lisp / bbdb / tex / bbdb.sty
CommitLineData
1a5de666
AB
1% bbdb.sty --- basic LaTeX style for TeXing BBDB
2%
3% Copyright (C) 2017 Free Software Foundation, Inc.
4%
5% This file is part of the Insidious Big Brother Database (aka BBDB),
6%
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.
11%
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.
16%
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/>.
19
20%% Commentary:
21%
22% This file defines a basic LaTeX style for TeXing BBDB.
23
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
30 \texttt{#2}%
31 \else
32 \href{mailto:#1}{\texttt{#2}}%
33 \fi}
34\def\bbdb@address#1#2{\emph{#1:} #2}
35\def\bbdb@xfield#1#2{\emph{#1:} #2}
36
37% \def\bbdb@separator#1{\hline}
38\def\bbdb@separator#1{\\\hline
39\multicolumn{\LT@cols}{@{}c@{}}{\hrulefill\ #1\rule{0pt}{2.2ex}\ \hrulefill}\\}
40
41\RequirePackage{longtable}
42\newenvironment{bbdb}[1]{%
43\let\name\bbdb@name
44\let\organization\bbdb@organization
45\let\affix\bbdb@affix
46\let\aka\bbdb@aka
47\let\phone\bbdb@phone
48\let\mail\bbdb@mail
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}}
54
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56
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
63 \texttt{#2}%
64 \else
65 \href{mailto:#1}{\texttt{#2}}%
66 \fi\par}
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}}
70
71\newenvironment{bbdbrecord}{%
72\smallbreak
73\parskip 0pt
74\parindent 0pt
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}
83
84\newcommand*{\bbdbseparator}[1]{\vspace{3ex}\noindent
85 \fbox{\parbox{\dimexpr\linewidth-2\fboxrule-2\fboxsep}%
86 {\centering\textbf{#1}}}%
87 \vspace{1ex}}
88
89% \endinput % Fails when inlining this file.