Debian Codegraph @

texmf-dist/source/latex/amsaddr/amsaddr.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright 2006--2022 Jérôme Lelong <[email protected]>
4 %
5 % It may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3c
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3c or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 %
14 % \fi
15 % \iffalse
16 %<*driver>
17 \ProvidesFile{amsaddr.dtx}
18 %</driver>
19 %<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
20 %<class>\ProvidesClass{amsaddr}
21 %<*class>
22 [2026/01/30 v1.3 .dtx amsaddr file]
23 %</class>
24 %
25 %<*driver>
26 \documentclass{ltxdoc}
27 \usepackage{a4}
28 \DisableCrossrefs
29 \CodelineIndex
30 \RecordChanges
31 \begin{document}
32 \DocInput{amsaddr.dtx}
33 \PrintChanges
34 \end{document}
35 %</driver>
36 % \fi
37 %
38 % \GetFileInfo{amsaddr.dtx}
39 % \CheckSum{319}
40 %
41 % \CharacterTable
42 % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
43 % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
44 % Digits \0\1\2\3\4\5\6\7\8\9
45 % Exclamation \! Double quote \" Hash (number) \#
46 % Dollar \$ Percent \% Ampersand \&
47 % Acute accent \' Left paren \( Right paren \)
48 % Asterisk \* Plus \+ Comma \,
49 % Minus \- Point \. Solidus \/
50 % Colon \: Semicolon \; Less than \<
51 % Equals \= Greater than \> Question mark \?
52 % Commercial at \@ Left bracket \[ Backslash \\
53 % Right bracket \] Circumflex \^ Underscore \_
54 % Grave accent \` Left brace \{ Vertical bar \|
55 % Right brace \} Tilde \~}
56 %
57 %
58 % \changes{v1.0}{2004/11/05}{Initial version}
59 % \changes{v1.1}{2013/04/02}{Fix space alignment}
60 % \changes{v1.2}{2022/09/10}{Fix error with {\tt \textbackslash dedicatory}}
61 % \changes{v1.3}{2026/01/30}{Honor {\tt \textbackslash emailaddrname}}
62 %
63 % \GetFileInfo{amsaddr.dtx}
64 %
65 % \DoNotIndex{\newcommand,\newenvironment}
66 %
67 % \date{\today}
68 % \title{The \textsf{amsaddr} class\thanks{This document
69 % corresponds to \textsf{amsaddr}~\fileversion, dated \filedate.}}
70 % \author{J\'er\^ome Lelong \\ \texttt{[email protected]}}
71 %
72 % \maketitle
73 %
74 % \begin{abstract}
75 % This package is intended to be used with the \textsf{amsart} document class only. It lets you move the authors' affiliations either just below the authors' names on the front page or as footnotes on the first page. The email addresses are always listed as a footnote on the front page.
76 % \end{abstract}
77 %
78 %
79 % \tableofcontents
80 %
81 % \section{License}
82 %
83 % This package is copyright \textcopyright\ 2006-2022 by:
84 %
85 % \begin{quote}
86 % J\'er\^ome Lelong, Grenoble INP - UGA, Grenoble, France\\
87 % E-Mail: \texttt{[email protected]}
88 % \end{quote}
89 %
90 % This program can be redistributed and/or modified under the terms
91 % of the LaTeX Project Public License, distributed from CTAN
92 % archives available from \texttt{http://www.latex-project.org/lppl.txt}; either
93 % version 1.3c of the License, or (at your option) any later version.
94 %
95 %
96 % \section{Usage}
97 %
98 %
99 % To use this package, you need to include the directive |\usepackage{amsaddr}| in your
100 % |.tex| file. Alternatively, you may also use it with the |foot| option
101 % |\usepackage[foot]{amsaddr}|. When using the |foot| option, the adresses are put as
102 % footnotes on the first page of the document.
103 %
104 % A typical usage looks like the following
105 %
106 % \begin{verbatim}
107 % \author{author one and author two}
108 % \address{common address of authors one and two}
109 %
110 % \author{author three}
111 % \address{author three address}
112 %
113 % \email{list of emails}
114 % \end{verbatim}
115 %
116 % If |amsaddr| is used without the |foot| option, the addresses declared with the |\address| command are printed just below the authors'names declared with the preceding |\author| command. The emails appear as a footnote like this
117 % \\
118 %
119 % {\it E-mail address}: {\texttt{email one}, \texttt{email two}, and so on}
120 % \\
121 % The text ``{\it E-mail address}'' can be customized by redefining |\emailaddrname|, which has default definition
122 % \begin{verbatim}
123 % \def\emailaddrname{{\itshape Email address}}
124 % \end{verbatim}
125 % Note the use of |\itshape| inside the definition.
126 %
127 % If the option |foot| was passed to the package, you may consider numbering authors' names so that you can use numbered footnotes for the affiliations.
128 %
129 % \begin{verbatim}
130 % \author{author one$^1$ and author two$^1$}
131 % \address{$^1$common address of authors one and two}
132 %
133 % \author{author three$^2$}
134 % \address{$^2$author three address}
135 %
136 % \email{list of emails}
137 % \end{verbatim}
138 %
139 % As in standard |amsart| documents, an option can be passed to the |\author| command to specify the replacement for the author's name on the running headers.
140 %
141 %\begin{center}
142 % \begin{verbatim}
143 %\author[header name of the author]{author name}
144 % \end{verbatim}
145 %\end{center}
146 %
147 %
148 % \StopEventually{}
149 %
150 % \section{Implementation}
151 %
152 % \begin{macrocode}
153 \def\filename{amsaddr}
154 \def\fileversion{v1.0}
155 \def\filedate{2006/12/12}
156 \ifx\protected@edef\@undefined
157 \let\protected@edef\edef
158 \fi
159 % \end{macrocode}
160 %
161 % The |foot| option enables to move the affiliation related material to the bottom of the fisrt page as footnotes.
162 %
163 % \begin{macrocode}
164 \newif\if@footaddr
165 \DeclareOption{foot}{\@footaddrtrue}
166 \ProcessOptions\relax
167 % \end{macrocode}
168 %
169 %
170 % \begin{macro}{\author}
171 %
172 % The |\author| macro can be used the same way as in other |amsart| documents. The variable |g@author| is used to count the total number of authors.
173 %
174 % \begin{macrocode}
175 \newcounter{g@author}
176 \setcounter{g@author}{0}
177 \renewcommand{\author}[2][]{%
178 \stepcounter{g@author}
179 \ifx\@empty\authors
180 \gdef\authors{#2}%
181 \else
182 \g@addto@macro\authors{\and#2}%
183 \fi
184 \g@addto@macro\addresses{\author{#2}}%
185 \@ifnotempty{#1}{%
186 \ifx\@empty\shortauthors
187 \gdef\shortauthors{#1}%
188 \else
189 \g@addto@macro\shortauthors{\and#1}%
190 \fi
191 }%
192 }
193 % \end{macrocode}
194 % \end{macro}
195 %
196 %
197 % \begin{macro}{\email}
198 % The |\email| command is used to specify the different authors. The email addresses can be specified in a unique command or using separate invocations of the command.
199 % \begin{macrocode}
200 \let\emails\@empty
201 \renewcommand{\email}[2][]{
202 \ifx\@empty\emails
203 \gdef\emails{\mbox{#2}}
204 \else
205 \g@addto@macro\emails{,\space\mbox{#2}}
206 \fi
207 }
208 % \end{macrocode}
209 % \end{macro}
210 %
211 % Process |\author| and |\address| macros
212 %
213 % \begin{macrocode}
214 \def\@set@authors@addresses{\par
215 \skip@30\p@
216 \centering
217 \begingroup
218 \def\author##1{\par\vskip\skip@\MakeUppercase{##1}}%
219 \def\\{\protect\linebreak}%
220 \centering
221 \def\address##1##2{\par\addvspace\bigskipamount%
222 {\itshape\ignorespaces##2}%
223 }%
224 \def\email##1##2{%
225 \@ifnotempty{##2}{, \ignorespaces{\ttfamily##2}}}%
226 \def\curraddr##1##2{}%
227 \def\urladdr##1##2{}%
228 \addresses
229 \endgroup
230 \par
231 }
232 % \end{macrocode}
233 %
234 % \begin{macro}{\@setfoot@addresses}
235 % The |\@setfoot@addresses| macro is used to print the addresses as footnotes. This macro is called when the |foot| option is passed to the package.
236 % \begin{macrocode}
237 \def\@setfoot@addresses{
238 \def\author##1{}%
239 \def\\{\unskip, \ignorespaces}%
240 \newif\if@firstaddr
241 \@firstaddrtrue
242 \def\address##1##2{%
243 \if@firstaddr\@firstaddrfalse\else\par\fi
244 \@ifnotempty{##1}{(\ignorespaces##1\unskip) }%
245 {\scshape\ignorespaces##2}%
246 }%
247 \def\email##1##2{}%
248 \def\curraddr##1##2{}%
249 \def\urladdr##1##2{}%
250 \addresses
251 }
252 % \end{macrocode}
253 % \end{macro}
254 % \begin{macro}{\@setaddresses}
255 % The |\@setaddresses| macro is used to process the addresses when they are to appear just below the authors' names on the front page.
256 % \begin{macrocode}
257 \def\@setaddresses{\par
258 \nobreak \begingroup
259 \def\author##1{\nobreak\addvspace\bigskipamount}%
260 \def\\{\unskip, \ignorespaces}%
261 \interlinepenalty\@M
262 \def\address##1##2{}%
263 \def\email##1##2{}%
264 \def\curraddr##1##2{\begingroup
265 \@ifnotempty{##2}{\nobreak\indent\curraddrname%
266 \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
267 ##2\par}\endgroup}%
268 \def\urladdr##1##2{\begingroup
269 \@ifnotempty{##2}{\nobreak\indent{\itshape URL}%
270 \@ifnotempty{##1}{, \ignorespaces##1\unskip}\/:\space
271 \ttfamily##2\par}\endgroup}%
272 \addresses
273 \endgroup
274 }
275 % \end{macrocode}
276 % \end{macro}
277 % \begin{macro}{\@setemails}
278 % The |\@setemails| macro is called by the |\maketitle| command to print the email addresses.
279 % \begin{macrocode}
280 \def\@setemails{%
281 \mbox{\emailaddrname:\space}{\ttfamily\emails}.
282 }
283 % \end{macrocode}
284 % \end{macro}
285 %
286 % \begin{macro}{\@maketitle}
287 % The |\@maketitle| macro is used to replace the standard |\makefile| command. Before issuing this command, no authors, affiliations, nor emails are printed.
288 % \begin{macrocode}
289 \def\@maketitle{%
290 \normalfont\normalsize
291 \let\@makefnmark\relax \let\@thefnmark\relax
292 \if@footaddr\@footnotetext{\@setfoot@addresses}\fi
293 \ifx\@empty\emails\else \@footnotetext{\@setemails}\fi
294 \ifx\@empty\@date\else \@footnotetext{\@setdate}\fi
295 \ifx\@empty\@subjclass\else \@footnotetext{\@setsubjclass}\fi
296 \ifx\@empty\@keywords\else \@footnotetext{\@setkeywords}\fi
297 \ifx\@empty\thankses\else \@footnotetext{%
298 \def\par{\let\par\@par}\@setthanks}\fi
299 \@mkboth{\@nx\shortauthors}{\@nx\shorttitle}%
300 \global\topskip42\p@\relax % 5.5pc " " " " "
301 \@settitle
302 \if@footaddr\ifx\@empty\authors \else \@setauthors \fi
303 \else%
304 \ifx\@empty\authors \else \@set@authors@addresses \fi
305 \fi
306 \ifx\@empty\@dedicatory
307 \else
308 \baselineskip18\p@
309 \vtop{\centering{\footnotesize\itshape\@dedicatory\@@par}%
310 \global\dimen@i\prevdepth}\prevdepth\dimen@i
311 \fi
312 \@setabstract
313 \normalsize
314 \if@titlepage
315 \newpage
316 \else
317 \dimen@34\p@ \advance\dimen@-\baselineskip
318 \vskip\dimen@\relax
319 \fi
320 \let\addresses\relax
321 \let\@setfoot@addresses\relax
322 } % end \@maketitle
323 % \end{macrocode}
324 % \end{macro}
325 %
326 % In |amsart| documents, affiliations are normally printed by the |\enddoc@text| command. To avoid a double printing of the considered material, the |\enddoc@text| macro has to be redefined.
327 %
328 % \begin{macrocode}
329 \def\enddoc@text{
330 \ifx\@empty\addresses\else \@setaddresses\fi
331 }
332 % \end{macrocode}
333 % \Finale
334 \endinput