summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLauthor.sty
blob: 2b1135d2467ac9cee0826a0981b338df87d59d32 (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
%%
%% This is file `PJLauthor.sty',
%% generated with the docstrip utility.

%% Copyright (C) 2021 by Jinwen XU
%% 
%% This is part of the ProjLib Toolkit.
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license is in
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesPackage{PJLauthor}
    [2021/07/12 Enhanced author information block]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\ifdefined\subjclass\endinput\fi

%%================================
%% Font and style
%%================================
\def\PJLauthor@font@author{\normalsize\normalfont\scshape}
\def\PJLauthor@font@address{\small\normalfont\itshape}
\def\PJLauthor@font@curraddr{\small\normalfont\itshape}
\def\PJLauthor@font@email{\small\normalfont\ttfamily}

%%================================
%% Lengths
%%================================
\newlength{\PJLauthor@length@innersep}
\setlength{\PJLauthor@length@innersep}{.3\baselineskip}
\newlength{\PJLauthor@length@sep}
\setlength{\PJLauthor@length@sep}{.5\baselineskip}
\newlength{\PJLauthor@length@aftersep}
\setlength{\PJLauthor@length@aftersep}{.3\baselineskip}

%%================================
%% The macros
%%================================
\newif\if@PJLauthor@affilon
\renewcommand*{\author}[1]{%
    \gappto\@author{\phantom{A}\\[-\baselineskip]%
    \vspace{\PJLauthor@length@sep}%
    \PJLauthor@font@author{#1}\\\phantom{}
    \@PJLauthor@affilonfalse}}
\providecommand*{\address}[1]{%
    \gappto\@author{\phantom{A}\\[-\baselineskip]%
        \if@PJLauthor@affilon\else%
            \vspace{\PJLauthor@length@innersep}%
        \fi%
        \@PJLauthor@affilontrue%
        \PJLauthor@font@address{#1}\\\phantom{}}%
}
\providecommand*{\curraddr}[1]{%
    \gappto\@author{\phantom{A}\\[-\baselineskip]%
        \if@PJLauthor@affilon\else%
            \vspace{\PJLauthor@length@innersep}%
        \fi%
        \@PJLauthor@affilontrue%
        \PJLauthor@font@curraddr{#1}\\\phantom{}}%
}
\providecommand*{\email}[1]{%
    \gappto\@author{\phantom{A}\\[-\baselineskip]%
        \if@PJLauthor@affilon\else%
            \vspace{\PJLauthor@length@innersep}%
        \fi%
        \@PJLauthor@affilontrue%
        \PJLauthor@font@email{#1}\\\phantom{}}%
}

%%================================
%% Adjustment
%%================================
\patchcmd{\@maketitle}{\begin{tabular}[t]{c}}{}{}{}
\patchcmd{\@maketitle}{\end{tabular}}{}{}{}
\def\@author{}
\pretocmd{\@maketitle}{%
    \pretocmd{\@author}{\vspace{-\PJLauthor@length@sep}}{}{\FAIL}%
    \apptocmd{\@author}{%
        \vspace{-\baselineskip}%
        \if@PJLauthor@affilon%
            \vspace{\PJLauthor@length@aftersep}%
        \fi%
    }{}{\FAIL}%
}{}{\FAIL}

\endinput
%%
%% End of file `PJLauthor.sty'.