summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/shortmathj/shortmathj.template.sty
blob: c5f0279f0110906dba4619d8850d129a82e3a11c (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
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{shortmathj}
  [2020/03/18 v0.5.0 LaTeX package to shortify names of AMS journals automatically]

\RequirePackage{ifthen}
\RequirePackage{xstring}

\newcommand{\shortifyAMSjournalname}[1]{%
\def\shortifiedAMSjournalname{}%
\edef\givenAMSjournalname{\detokenize{#1}}%
\StrLeft{\givenAMSjournalname}{1}[\firstletter]%
%%%{{SHORTMAP
% The following rows present here only as examples
% The content of the block is generated automatically
\ifthenelse{\equal{\firstletter}{\detokenize{D}}}{%
\ifthenelse{\equal{\givenAMSjournalname}{\detokenize{Discrete \& Computational Geometry}}}{\def\shortifiedAMSjournalname{Discr. Comp. Geom.}}{}%
\ifthenelse{\equal{\givenAMSjournalname}{\detokenize{Discrete Applied Mathematics}}}{\def\shortifiedAMSjournalname{Discr. Appl. Math.}}{}%
}{}%
\ifthenelse{\equal{\firstletter}{\detokenize{B}}}{%
\ifthenelse{\equal{\givenAMSjournalname}{\detokenize{Bulletin of the American Mathematical Society}}}{\def\shortifiedAMSjournalname{Bull. Amer. Math. Soc.}}{}%
}{}%
%%%}}SHORTMAP
\ifthenelse{\equal{\shortifiedAMSjournalname}{}}{#1}{\shortifiedAMSjournalname{}}%
}


\endinput