summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hep-paper/hep-title.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/hep-paper/hep-title.sty')
-rw-r--r--Master/texmf-dist/tex/latex/hep-paper/hep-title.sty262
1 files changed, 165 insertions, 97 deletions
diff --git a/Master/texmf-dist/tex/latex/hep-paper/hep-title.sty b/Master/texmf-dist/tex/latex/hep-paper/hep-title.sty
index 6a9c236ac0e..b66977a5347 100644
--- a/Master/texmf-dist/tex/latex/hep-paper/hep-title.sty
+++ b/Master/texmf-dist/tex/latex/hep-paper/hep-title.sty
@@ -16,64 +16,83 @@
%% LaTeX version 2005/12/01 or later.
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{hep-title}[2021/06/01 v1.7 Title macros for publications in High Energy Physics]
+\ProvidesPackage{hep-title}[2021/08/01 v1.8 Title macros for publications in High Energy Physics]
\providecommand{\online}[2]{\ttfamily{#2}}%
-\providecommand{\email}[1]{\online{mailto:#1}{#1}}
+\newcommand{\hep@email}[1]{\online{mailto:#1}{#1}}
+\providecommand\email{\hep@email}
\AtEndOfPackage{\@ifpackageloaded{hyperref}{%
\renewcommand{\online}[2]{\href{#1}{\nolinkurl{#2}}}%
}{}
}
\newif\ifhep@first%
-\date{\vspace{-4ex}}
-\RequirePackage{titling}
-\setlength{\thanksmarkwidth}{1.5em}
+\newcommand{\hep@multi@ref}[1]{%
+ \hep@firsttrue%
+ \forcsvlist{%
+ \ifhep@first\hep@firstfalse\else\textsuperscript,\fi\ref%
+ }{#1}%
+}
+\renewcommand{\email}[2][]{\unskip\thanks[#1]{\hep@email{#2}}}%
+\AtBeginDocument{
+ \let\hep@maketitle\maketitle
+ \renewcommand\maketitle{\hep@maketitle\let\email\hep@email}
+}
\let\hep@preprint@font\relax
\newcommand{\preprintfont}[1]{\def\hep@preprint@font{#1}}
-\let\hep@series@font\relax
-\newcommand{\seriesfont}[1]{\def\hep@series@font{#1}}
-\let\hep@title@font\relax
-\newcommand{\titlefont}[1]{\def\hep@title@font{#1}}
-\let\hep@subtitle@font\relax
-\newcommand{\subtitlefont}[1]{\def\hep@subtitle@font{#1}}
-\let\hep@editor@font\relax
-\newcommand{\editorfont}[1]{\def\hep@editor@font{#1}}
-\let\hep@author@font\relax
-\newcommand{\authorfont}[1]{\def\hep@author@font{#1}}
-\let\hep@affiliation@font\relax
-\newcommand{\affiliationfont}[1]{\def\hep@affiliation@font{#1}}
-\let\hep@date@font\relax
-\newcommand{\datefont}[1]{\def\hep@date@font{#1}}
+\preprintfont{\scshape\small}
+\let\hep@preprint\relax
+\newcommand\preprint[1]{\def\hep@preprint{#1}}
+\RequirePackage{varwidth}
+\newcommand{\hep@preprint@box}{%
+ \begin{varwidth}{\textwidth}%
+ \hep@preprint@font\hep@preprint%
+ \end{varwidth}%
+}
+\RequirePackage{calc}
+\RequirePackage{atbegshi}
+\RequirePackage{picture}
+\newcommand{\placepreprint}{%
+ \AtBeginShipoutFirst{%
+ \put(
+ \textwidth+\oddsidemargin-\widthof{\hep@preprint@box},
+ -2pt-\topmargin-\heightof{\hep@preprint@box}
+ ){\normalfont\hep@preprint@box}
+ }
+}
\newcommand{\preseries}[1]{\def\hep@pre@series{#1}}
\newcommand{\series}[1]{\def\hep@series{#1}}
\newcommand{\postseries}[1]{\def\hep@post@series{#1}}
-\newcommand{\presubtitle}[1]{\def\hep@pre@sub@title{#1}}
-\newcommand{\subtitle}[1]{\def\hep@sub@title{#1}}
-\newcommand{\postsubtitle}[1]{\def\hep@post@sub@title{#1}}
+\let\hep@series@font\relax
+\newcommand{\seriesfont}[1]{\def\hep@series@font{#1}}
\preseries{\begin{center}\Large\hep@series@font}
\postseries{\par\end{center}}
+\RequirePackage{titling}
+\setlength{\thanksmarkwidth}{1.5em}
+\renewcommand{\maketitlehooka}{%
+ \placepreprint\vspace{-\bigskipamount}%
+ \@ifundefined{hep@series}{}{%
+ \hep@pre@series\hep@series\hep@post@series%
+ }%
+ \vspace{-\bigskipamount}%
+}
+\let\hep@title@font\relax
+\newcommand{\titlefont}[1]{\def\hep@title@font{#1}}
\pretitle{\begin{center}\LARGE\hep@title@font}
\posttitle{\par\end{center}}
+
+\newcommand{\presubtitle}[1]{\def\hep@pre@sub@title{#1}}
+\newcommand{\subtitle}[1]{\def\hep@sub@title{#1}}
+\newcommand{\postsubtitle}[1]{\def\hep@post@sub@title{#1}}
+
+\let\hep@subtitle@font\relax
+\newcommand{\subtitlefont}[1]{\def\hep@subtitle@font{#1}}
\presubtitle{\begin{center}\Large\hep@subtitle@font}
\postsubtitle{\par\end{center}}
-\preauthor{%
- \begin{center}\large\hep@author@font\lineskip.5em\begin{tabular}[t]{c}%
-}
-\postauthor{\end{tabular}\par\end{center}}
-\predate{\begin{center}\hep@date@font}
-\postdate{\par\end{center}}
+\RequirePackage{authblk}
\newcounter{editors}
\newcommand\hep@editorlist{}
\newcommand\hep@editors{}
-\newcommand{\hep@multi@ref}[1]{%
- \hep@firsttrue%
- \forcsvlist{%
- \ifhep@first\hep@firstfalse\else\textsuperscript,\fi\ref%
- }{#1}%
-}
-\RequirePackage{authblk}
\newcommand\editor[2][]{%
- \renewcommand{\email}[1]{\unskip\thanks{\online{mailto:##1}{##1}}}%
\ifnewaffil%
\addtocounter{affil}{1}%
\edef\AB@thenote{\arabic{affil}}%
@@ -112,7 +131,7 @@
\protect\@nameuse{@sep\number\c@editors}%
\protect\Authfont#2%
\if\relax#1\relax\else%
- \ \protect\hep@multi@ref{\AB@note}%
+ \protect\hep@multi@ref{\AB@note}%
\fi%
}%
\endgroup%
@@ -121,49 +140,96 @@
\fi%
\newaffilfalse%
}
+\let\hep@editor@font\relax
+\newcommand{\editorfont}[1]{\def\hep@editor@font{#1}}
\newcommand{\preeditor}[1]{\def\hep@pre@editor{#1}}
\newcommand{\posteditor}[1]{\def\hep@post@editor{#1}}
-\preeditor{\begin{center}\large\hep@editor@font\lineskip.5em
- \ifnum\value{editors}>1\relax Editors\else Editor\fi:
+\newcommand{\editortitle}[2]{
+ \def\hep@editor@title{#1}
+ \def\hep@editor@title@pl{#2}
+}
+\newcommand{\editortitlefont}[1]{\def\hep@editor@title@font{#1}}
+\newcommand{\preeditortitle}[1]{\def\hep@pre@editor@title{#1}}
+\newcommand{\posteditortitle}[1]{\def\hep@post@editor@title{#1}}
+\editortitle{Editor}{Editors}
+\editortitlefont{\itshape}
+\preeditortitle{\hep@editor@title@font}
+\posteditortitle{: }
+\preeditor{%
+ \begin{center}%
+ \large\hep@editor@font\lineskip.5em%
+ \begin{tabular}[t]{c}{%
+ \hep@pre@editor@title%
+ \ifnum\value{editors}>1\relax%
+ \hep@editor@title@pl%
+ \else%
+ \hep@editor@title%
+ \fi%
+ \hep@post@editor@title%
+ }%
}
-\posteditor{\par\end{center}}
+\posteditor{\end{tabular}\par\end{center}}
\renewcommand{\maketitlehookb}{%
\@ifundefined{hep@sub@title}{}{%
\hep@pre@sub@title\hep@sub@title\hep@post@sub@title%
}%
+ \smallskip%
\ifx\hep@editorlist\AB@empty\else%
\hep@pre@editor\hep@editorlist\hep@post@editor%
\fi
}
-\newif\ifhep@lining\hep@liningtrue
-\ifhep@lining
- \renewcommand{\Affilfont}{\small\hep@affiliation@font}
-\else
- \renewcommand{\Affilfont}{\small\ostyle\hep@affiliation@font}
-\fi
-\renewcommand\Authfont{\hep@author@font}
-\newcounter{affiliation}
-\renewcommand{\theaffiliation}{%
- \textsuperscript{\normalfont\arabic{affiliation}}%
-}
\RequirePackage{xpatch}
\xpatchcmd{\author}{%
\protect\Authfont#2\AB@authnote{\AB@note}%
}{%
\protect\Authfont#2%
- \if\relax#1\relax\else\protect\hep@multi@ref{\AB@note}\fi%
+ \if\relax#1\relax\else\unskip\protect\hep@multi@ref{\AB@note}\fi%
}{}{}
+\let\hep@author@font\relax
+\newcommand{\authorfont}[1]{\def\hep@author@font{#1}}
+\renewcommand\Authfont{\hep@author@font}
+\newcommand{\authortitle}[2]{
+ \def\hep@author@title{#1}
+ \def\hep@author@title@pl{#2}
+}
+\newcommand{\authortitlefont}[1]{\def\hep@author@title@font{#1}}
+\newcommand{\preauthortitle}[1]{\def\hep@pre@author@title{#1}}
+\newcommand{\postauthortitle}[1]{\def\hep@post@author@title{#1}}
+\authortitle{Author}{Authors}
+\authortitlefont{\itshape}
+\preauthortitle{\hep@author@title@font}
+\postauthortitle{: }
+\preauthor{%
+ \begin{center}%
+ \large\hep@author@font\lineskip.5em%
+ \begin{tabular}[t]{c}{%
+ \ifnum\value{editors}>0\relax%
+ \hep@pre@author@title%
+ \ifnum\value{authors}>1\relax%
+ \hep@author@title@pl\else\hep@author@title%
+ \fi\hep@post@author@title%
+ \fi%
+ }%
+}
+\postauthor{\end{tabular}\par\end{center}}
+\newcounter{affiliation}
+\renewcommand{\theaffiliation}{%
+ \textsuperscript{\normalfont\alph{affiliation}}%
+}
\xpatchcmd{\affil}{%
\AB@affilnote{\AB@note}%
}{%
\protect\refstepcounter{affiliation}\protect\label{\AB@note}%
\if\relax#1\relax\else\protect\ref{\AB@note}\fi%
}{}{}
-\let\hep@author\author
-\def\author{%
- \renewcommand{\email}[1]{\unskip\thanks{\online{mailto:##1}{##1}}}%
- \hep@author
-}
+\let\hep@affiliation@font\relax
+\newcommand{\affiliationfont}[1]{\def\hep@affiliation@font{#1}}
+\newif\ifhep@lining\hep@liningtrue
+\ifhep@lining
+ \renewcommand{\Affilfont}{\small\hep@affiliation@font}
+\else
+ \renewcommand{\Affilfont}{\small\ostyle\hep@affiliation@font}
+\fi
\newcommand\hep@penalty{\if@twocolumn85\else50\fi}
\newcommand\hep@active@comma{,\penalty-\hep@penalty\relax}
\newcommand\hep@cat@comma@active{\catcode`\,\active}
@@ -180,50 +246,52 @@
\newcommand{\affiliation}{%
\begingroup\hep@cat@comma@active\hep@affiliation%
}
-\let\hep@preprint\relax
-\newcommand\preprint[1]{\def\hep@preprint{#1}}
-\RequirePackage{varwidth}
-\RequirePackage{relsize}
-\newcommand{\hep@preprint@box}{%
- \begin{varwidth}{\textwidth}%
- \smaller[.5]\hep@preprint@font\hep@preprint%
- \end{varwidth}%
-}
-\preprintfont{\scshape}
-\RequirePackage{calc}
-\RequirePackage{atbegshi}
-\RequirePackage{picture}
-\newcommand{\placepreprint}{%
- \AtBeginShipoutFirst{%
- \put(
- \textwidth+\oddsidemargin-\widthof{\hep@preprint@box},
- -2pt-\topmargin-\heightof{\hep@preprint@box}
- ){\normalfont\hep@preprint@box}
- }
-}
-\renewcommand{\maketitlehooka}{%
- \placepreprint\vspace{-\bigskipamount}%
- \@ifundefined{hep@series}{}{%
- \hep@pre@series\hep@series\hep@post@series%
- }%
-}
-
+\date{\vspace{-4ex}}
+\let\hep@date@font\relax
+\newcommand{\datefont}[1]{\def\hep@date@font{#1}}
+\predate{\begin{center}\hep@date@font}
+\postdate{\par\end{center}}
\@ifundefined{abstract}{}{%
\let\hep@abstract\abstract%
\renewcommand\abstract{\hep@abstract\noindent\ignorespaces}%
+ \if@twocolumn
+ \RequirePackage{environ}
+ \RequirePackage{abstract}
+ \renewcommand{\abstitleskip}{-3ex}
+ \NewEnviron{abstract*}{%
+ \twocolumn[\maketitle\vspace{-5ex}%
+ \begin{onecolabstract}\noindent\BODY\end{onecolabstract}%
+ \vspace{.5cm}]\saythanks%
+ }%
+ \else
+ \newenvironment{abstract*}{%
+ \maketitle\begin{abstract}%
+ }{%
+ \end{abstract}%
+ }
+ \fi
+}
+\let\hep@thanks\thanks
+\AtEndDocument{\let\thanks\hep@thanks}
+\DeclareRobustCommand\thanks[2][]{%
+ \AfterEndPreamble{%
+ \if\relax#1\relax%
+ \footnotemark%
+ \else%
+ \renewcommand\thefootnote{\textsuperscript{\@fnsymbol\c@footnote}}%
+ \protect\refstepcounter{footnote}\protect\label{#1}%
+ \renewcommand\thefootnote{\@arabic\c@footnote}%
+ \fi%
+ \protected@xdef\@thanks{%
+ \@thanks\protect\footnotetext[\the\c@footnote]{#2}%
+ }
+ \if@twocolumn
+ \protected@xdef\@bs@thanks{%
+ \@bs@thanks\protect\footnotetext[\the\c@footnote]{#2}%
+ }%
+ \fi%
+ }%
}
-\if@twocolumn
- \RequirePackage{environ}
- \RequirePackage{abstract}
- \renewcommand{\abstitleskip}{-3ex}
- \NewEnviron{abstract*}{%
- \twocolumn[\maketitle\vspace{-5ex}%
- \begin{onecolabstract}\noindent\BODY\end{onecolabstract}%
- \vspace{.5cm}]\saythanks%
- }
-\else
- \newenvironment{abstract*}{\maketitle\begin{abstract}}{\end{abstract}}
-\fi
\endinput
%%