summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLamssim.sty
blob: 89fecc6d8a5df36e6a881c965780b4527147826b (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
%%
%% This is file `PJLamssim.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{PJLamssim}
    [2021/07/23 Simulate some features of amsart]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\ifdefined\subjclass\endinput\fi

\RequirePackage{PJLauthor}
\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@PJLamssim@maketitle\@PJLamssim@maketitlefalse
\newif\if@PJLamssim@absbefore\@PJLamssim@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@PJLamssim@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\@PJLamssim@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@PJLamssim@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\@PJLamssim@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 `PJLamssim.sty'.