summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLauthor.sty
blob: a1ba35631e149896c1f91176c1a2138b93caefda (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
%%
%% 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/08/17 Enhanced author information block]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\ifdefined\subjclass\endinput\fi

\SetupKeyvalOptions{
    family = @PJLauthor,
    prefix = @PJLauthor@,
}
\DeclareBoolOption[false]{amsfashion}
\ProcessKeyvalOptions*\relax

%%================================
%% 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}

\ifbool{@PJLauthor@amsfashion}{

\RequirePackage{PJLlang}
\RequirePackage{calc}

\providecommand{\conditionalbfseries}{\bfseries}

\def\keywordsnameEN{\textsc{Key words and phrases}}
\def\keywordsnameFR{\textsc{Mots et phrases clés}}
\def\keywordsnameDE{\textsc{Schlüsselwörter und Phrasen}}
\def\keywordsnameIT{\textsc{Parole e frasi chiave}}
\def\keywordsnamePT{\textsc{Palavras e frases chave}}
\def\keywordsnameBR{\textsc{Palavras e frases chave}}
\def\keywordsnameES{\textsc{Palabras y frases clave}}
\def\keywordsnameCN{关键词}
\def\keywordsnameTC{關鍵詞}
\def\keywordsnameJP{キーワード}
\def\keywordsnameRU{Ключевые слова и фразы}

\def\PJL@keywords{}
\providecommand*{\keywords}[1]{\def\PJL@keywords{#1}}

\def\PJL@dedicatory{}
\providecommand*{\dedicatory}[1]{\def\PJL@dedicatory{#1}}

\AtEndPreamble{
\let\footnotemark@PJLoriginal\footnotemark%
\let\footnotemark\relax%
\let\thanks@PJLoriginal\thanks%
\newlength\PJL@starlength
\setlength{\PJL@starlength}{\widthof{*}}
\newcommand*{\PJL@prethanks}[1]{\thanks@PJLoriginal{\hspace*{-\PJL@starlength}#1}}
\renewcommand*{\thanks}[1]{%
    \ifx#1\@empty\else%
        \apptocmd{\@title}{%
            \thanks@PJLoriginal{\hspace*{-\PJL@starlength}#1}%
        }{}{\FAIL}%
    \fi}
\let\author@PJLoriginal\author
\renewcommand{\author}[1]{%
    \author@PJLoriginal{%
        \let\footnotemark\footnotemark@PJLoriginal%
        \let\thanks\thanks@PJLoriginal%
        #1%
        \let\footnotemark\relax%
    }%
}
}

\let\abstract@PJLoriginal\abstract%
\let\endabstract@PJLoriginal\endabstract%
\newif\if@PJLauthor@maketitle\@PJLauthor@maketitlefalse
\newif\if@PJLauthor@absbefore\@PJLauthor@absbeforefalse
\RequirePackage{fancyvrb}
\providecommand*\protected@iwrite[3]{%
  \begingroup
  \let\thepage\relax
  #2%
  \let\protect\@unexpandable@protect
  \edef\reserved@a{\immediate\write#1{#3}}\reserved@a
  \endgroup
  \if@nobreak\ifvmode\nobreak\fi\fi
}
\patchcmd{\FVB@VerbatimOut}
  {\immediate\write\FV@OutFile}
  {\protected@iwrite\FV@OutFile{}}
  {}{}
\renewenvironment{abstract}{%
    \VerbatimOut{\jobname.pjlabs}%
}{
    \endVerbatimOut%
    \if@PJLauthor@maketitle%
        \begin{abstract@PJLoriginal}%
            \input{\jobname.pjlabs}%
        \end{abstract@PJLoriginal}%
        % \ifx\PJL@keywords\@empty\else%
        %     \par\smallskip\noindent{\conditionalbfseries\csname keywordsname\csname\languagename ABBR\endcsname\endcsname.}~\PJL@keywords%
        % \fi%
    \else%
        \global\@PJLauthor@absbeforetrue%
    \fi%
}

\AtEndPreamble{%
\patchcmd{\@maketitle}{\@date}{%
    \ifx\@date\@empty\vspace{-2\baselineskip}%
    \else\@date\fi%
    \ifx\PJL@dedicatory\@empty\else%
        \ifx\@date\@empty\vspace{2\baselineskip}\fi%
        \par\vspace{-\parskip}\bigskip%
        {\itshape\PJL@dedicatory}%
        \ifx\@date\@empty%
            \vspace{-1.7\baselineskip}%
            \vspace{-\parskip}%
        \fi%
    \fi%
}{}{\FAIL}
\pretocmd{\maketitle}{%
    \ifx\PJL@keywords\@empty\else%
    \PJL@prethanks{{\protect\conditionalbfseries%
    \csname keywordsname\csname\languagename ABBR\endcsname\endcsname.}%
    ~\PJL@keywords}%
    \fi}{}{\FAIL}
\apptocmd{\maketitle}{%
    \if@PJLauthor@absbefore%
        \begin{abstract@PJLoriginal}%
            \input{\jobname.pjlabs}%
            % \ifx\PJL@keywords\@empty\else%
            %     \par\smallskip\noindent{\conditionalbfseries\csname keywordsname\csname\languagename ABBR\endcsname\endcsname.}~\PJL@keywords%
            % \fi%
        \end{abstract@PJLoriginal}%
    \fi%
    \global\let\address\relax
    \global\let\curraddr\relax
    \global\let\email\relax
    \global\let\dedicatory\relax
    \global\let\keywords\relax
    \global\@PJLauthor@maketitletrue
}{}{\FAIL}
}

\newcommand*\subjclass[2][2020]{%
    \def\@subjclass{#2}%
    \@ifundefined{subjclassname@#1}{%
        \ClassWarning{\@currname}{Unknown edition (#1) of Mathematics
        Subject Classification; using '2020'}%
        \expandafter\let\expandafter\subjclassname\csname subjclassname@2020\endcsname
    }{%
        \expandafter\let\expandafter\subjclassname\csname subjclassname@#1\endcsname
    }%
    \PJL@prethanks{{\itshape\subjclassname.}\enspace\@subjclass{}.}
}
\@namedef{subjclassname@1991}{%
  \textup{1991} Mathematics Subject Classification}
\@namedef{subjclassname@2000}{%
  \textup{2000} Mathematics Subject Classification}
\@namedef{subjclassname@2010}{%
  \textup{2010} Mathematics Subject Classification}
\@namedef{subjclassname@2020}{%
  \textup{2020} Mathematics Subject Classification}

}

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