% \iffalse meta-comment
%
% Copyright (C) 2019 by Jan Hajer
% -----------------------------------
%
% This file 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.
%
% \fi
%
% \iffalse
%\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%\ProvidesPackage{hep-paper}[2021/08/01 v1.8 Publications in High Energy Physics]
%\ProvidesPackage{hep-title}[2021/08/01 v1.8 Title macros for publications in High Energy Physics]
%\ProvidesPackage{hep-font}[2021/08/01 v1.8 Font adjustments for publications in High Energy Physics]
%
%
% \section{Font}
%
%<*package|font>
%
% Set the whole text to sans serif if requested.
% \begin{macrocode}
%\newif\ifhep@serif\hep@seriftrue
\ifhep@serif\else
\renewcommand{\familydefault}{\sfdefault}
\fi
% \end{macrocode}
%
% \begin{macro}{\ifxetexorluatex}
% Load the \software{ifluatex} \cite{ifluatex} and \software{ifxetex} \cite{ifxetex} packages.
% Define the "\ifxetexorluatex" conditional checking if the package is executed by \hologo{LuaLaTeX} or \hologo{XeLaTeX}.
% \begin{macrocode}
\RequirePackage{ifluatex}
\RequirePackage{ifxetex}
\newif\ifxetexorluatex
\ifxetex\xetexorluatextrue
\else
\ifluatex\xetexorluatextrue
\else\xetexorluatexfalse
\fi
\fi
% \end{macrocode}
% \end{macro}
%
% Pick the correct font encoding depending on the engine used and load the \software{fontenc} package \cite{fontenc} with this encoding.
% For details of the font encoding see \cite{encguide}.
% \begin{macrocode}
\ifxetexorluatex
\def\hep@encoding{TU}
\else
\def\hep@encoding{T1}
\fi
\RequirePackage[\hep@encoding]{fontenc}
% \end{macrocode}
% Fix the remaining \CM fonts \cite{fix-cm}, load the \LM font via \software{cfr-lm} \cite{cfr-lm} supported also by \software{lmodern} \cite{lmodern}, the \software{textcomp} extension \cite{textcomp}, and the \software{microtype} font optimization \cite{microtype}.
% Adjust the figures according to the "lining" option and ensure that tables always use lining, using the \software{etoolbox} package \cite{etoolbox}.
% \begin{macrocode}
\RequirePackage{fix-cm}
\RequirePackage{microtype}
%\newif\ifhep@lining
\ifxetexorluatex
\RequirePackage{nfssext-cfr}
\RequirePackage{lmodern}
\else
\ifhep@lining
\RequirePackage[rm={lining},sf={lining},tt={lining}]{cfr-lm}
\else
\RequirePackage{cfr-lm}
\fi
\fi
\RequirePackage{etoolbox}
% \AtBeginEnvironment{tabular}{\tlstyle}
\RequirePackage{textcomp}
% \end{macrocode}
%
% Define bold and sans serif small caps font shapes using the \software{fontspec} package \cite{fontspec}.
% The font abbreviations are
% \begin{description}[nosep]
% \item[lmr] \LM regular font
% \item[lmss] \LM sans serif font
% \item[cmss] \CM sans serif font
% \item[xcmss] Extended \CM sans serif font (from the \software{sansmathfonts} package \cite{sansmathfonts})
% \item[bx] Bold extended series
% \item[b] Bold series
% \item[m] Medium weight and width series
% \item[c] Medium weight, condensed width series
% \item[sc] Caps and small caps font shape
% \end{description}
% \begin{macrocode}
\newcommand{\hep@sf@fontshape}[3]{%
\DeclareFontShape{\hep@encoding}{\sfdefault}{#1}{#2}{#3}{}%
}
\newcommand{\hep@rm@fontshape}[3]{%
\DeclareFontShape{\hep@encoding}{\rmdefault}{#1}{#2}{#3}{}%
}
\ifxetexorluatex
\RequirePackage{fontspec}
\setmainfont{Latin Modern Roman}[
UprightFeatures={SmallCapsFont={[lmromancaps10-regular.otf]}},
BoldFeatures={
SmallCapsFeatures={Letters=SmallCaps},
SmallCapsFont={[cmunbx.otf]}
}
]
\hep@sf@fontshape{bx}{sc}{<->cmssbxcsc10}{}
\hep@sf@fontshape{b}{sc}{<->cmssbxcsc10}{}
\hep@sf@fontshape{m}{scit}{<->cmsscsci10}{}
\hep@sf@fontshape{m}{sc}{%
<-9>cmsscsc8<9-10>cmsscsc9<10->cmsscsc10%
}{}
\else
\rmfamily
\ifhep@lining
\RequirePackage{slantsc}
\hep@rm@fontshape{b}{sc}{<->ssub*cmr/bx/sc}{}
\hep@rm@fontshape{bx}{sc}{<->ssub*cmr/bx/sc}{}
\hep@rm@fontshape{b}{scsl}{<->ssub*cmr/bx/scsl}{}
\hep@rm@fontshape{bx}{scsl}{<->ssub*cmr/bx/scit}{}
\hep@rm@fontshape{b}{scit}{<->ssub*cmr/bx/scsl}{}
\hep@rm@fontshape{bx}{scit}{<->ssub*cmr/bx/scit}{}
\else
\DeclareFontFamily{\hep@encoding}{hfor}{}
\DeclareFontShape{\hep@encoding}{hfor}{bx}{sc}{
<-6>hfoxc0500<6-7>hfoxc0600<7-8>hfoxc0700<8-9>hfoxc0800
<9-10>hfoxc0900<10-12>hfoxc1000<12-17>hfoxc1200<17->hfoxc1728
}{}
\DeclareFontShape{\hep@encoding}{hfor}{bx}{scsl}{
<-6>hfooc0500<6-7>hfooc0600<7-8>hfooc0700<8-9>hfooc0800
<9-10>hfooc0900<10-12>hfooc1000<12-17>hfooc1200<17->hfooc1728
}{}
\hep@rm@fontshape{b}{sc}{<->ssub*hfor/bx/sc}{}
\hep@rm@fontshape{bx}{sc}{<->ssub*hfor/bx/sc}{}
\hep@rm@fontshape{bx}{scsl}{<->ssub*hfor/bx/scsl}{}
\hep@rm@fontshape{b}{scit}{<->ssub*hfor/bx/scsl}{}
\hep@rm@fontshape{bx}{scit}{<->ssub*hfor/bx/scsl}{}
\hep@rm@fontshape{b}{scsl}{<->ssub*hfor/bx/scsl}{}
\fi
\sffamily
\hep@sf@fontshape{m}{sc}{<->ssub*xcmss/m/sc}{}
\hep@sf@fontshape{b}{sc}{<->ssub*xcmss/bx/sc}{}
\hep@sf@fontshape{bx}{sc}{<->ssub*xcmss/bx/sc}{}
\hep@sf@fontshape{m}{scit}{<->ssub*xcmss/m/scit}{}
\hep@sf@fontshape{b}{scit}{<->ssub*xcmss/bx/scit}{}
\hep@sf@fontshape{bx}{scit}{<->ssub*xcmss/bx/scit}{}
\hep@sf@fontshape{m}{scsl}{<->ssub*xcmss/m/scit}{}
\hep@sf@fontshape{b}{scsl}{<->ssub*xcmss/bx/scit}{}
\hep@sf@fontshape{bx}{scsl}{<->ssub*xcmss/bx/scit}{}
\hep@sf@fontshape{m}{ui}{<->cmssu10}{}
\fi
% \end{macrocode}
%
% Load the \software{inputenc} package \cite{inputenc}.
% \begin{macrocode}
\ifxetexorluatex\else
\RequirePackage[utf8]{inputenc}
\fi
% \end{macrocode}
%
%
%
% \subsection{Math fonts}
%
%<*package|font>
%
% \begin{macrocode}
%\RequirePackage{pdftexcmds}
%\def\hep@symbols{true}
%\RequirePackage{amstext}
% \end{macrocode}
%
% Define conditionals based on the "symbols" package option.
% \begin{macrocode}
\newif\ifhep@symbols
\ifnum\pdf@strcmp{\hep@symbols}{false}=0\else\hep@symbolstrue\fi
\newif\ifhep@ams
\ifnum\pdf@strcmp{\hep@symbols}{ams}=0 \hep@amstrue\fi
\newif\ifhep@minion
\ifnum\pdf@strcmp{\hep@symbols}{minion}=0 \hep@miniontrue\fi
% \end{macrocode}
%
% Load the \software{fixmath} \cite{fixmath} and \software{textalpha} \cite{textalpha} packages ensuring that upper Greek letters in math mode are italic and providing upright Greek letters in text mode, respectively.
% Ensure that both "\text" and "\mathrm" produce upright Greek letters.
% \begin{macrocode}
\ifhep@symbols
\RequirePackage{fixmath}
\RequirePackage{textalpha}
\def\hep@greek#1{%
\expandafter\let\csname math%
\expandafter\@gobble\string#1\endcsname=#1%
\edef#1{%
\noexpand\TextOrMath{%
\expandafter\noexpand\csname text%
\expandafter\@gobble\string#1\endcsname%
}{%
\noexpand\ifnum\noexpand\fam=0
\noexpand\text{%
\expandafter\noexpand\csname text%
\expandafter\@gobble\string#1\endcsname%
}%
\noexpand\else
\expandafter\noexpand\csname math%
\expandafter\@gobble\string#1\endcsname%
\noexpand\fi
}%
}%
}
\hep@greek\alpha \hep@greek\beta \hep@greek\gamma
\hep@greek\delta \hep@greek\epsilon \hep@greek\zeta
\hep@greek\eta \hep@greek\theta \hep@greek\iota
\hep@greek\kappa \hep@greek\lambda \hep@greek\mu
\hep@greek\nu \hep@greek\xi \hep@greek\pi
\hep@greek\rho \hep@greek\sigma \hep@greek\tau
\hep@greek\upsilon \hep@greek\phi \hep@greek\chi
\hep@greek\psi \hep@greek\omega
\hep@greek\Gamma \hep@greek\Delta \hep@greek\Theta
\hep@greek\Lambda \hep@greek\Xi \hep@greek\Pi
\hep@greek\Sigma \hep@greek\Upsilon \hep@greek\Phi
\hep@greek\Psi \hep@greek\Omega
% \end{macrocode}
% Ensure that this works also after loading other fonts packages such as \software{cfr-lm} using \software{substitutefont} \cite{substitutefont}.
% \begin{macrocode}
\ifxetexorluatex
% missing code
\else
\RequirePackage{substitutefont}
\substitutefont{LGR}{\rmdefault}{lmr}
\DeclareFontFamily{LGR}{\rmdefault}{}
\DeclareFontShape{LGR}{\rmdefault}{b}{n}{<->ssub*lmr/bx/n}{}
\DeclareFontShape{LGR}{\rmdefault}{b}{sc}{<->ssub*lmr/bx/sc}{}
\substitutefont{LGR}{\ttdefault}{lmtt}
\DeclareFontFamily{LGR}{\ttdefault}{}
\DeclareFontShape{LGR}{\ttdefault}{b}{n}{<->ssub*lmtt/bx/n}{}
\substitutefont{LGR}{\sfdefault}{lmss}
\DeclareFontFamily{LGR}{\sfdefault}{}
\DeclareFontShape{LGR}{\sfdefault}{b}{n}{<->ssub*lmss/bx/n}{}
\DeclareFontShape{LGR}{\sfdefault}{b}{sc}{<->ssub*lmss/bx/sc}{}
\fi
% \end{macrocode}
%
% Either load the \software{MnSymbol} package \cite{MnSymbol} or the the \software{exscale} package in order to fix Latin Modern "lmex" fonts.
% Additionally, load the \software{amssymb} package \cite{amsfonts} which provides further math symbols and also loads the \software{amsfonts} package \cite{amsfonts}.
% \begin{macrocode}
\ifhep@minion
\RequirePackage{MnSymbol}
\else
\RequirePackage{exscale}
\RequirePackage{amssymb}
\fi
\fi
% \end{macrocode}
%
% \begin{macro}{\mathsf}
% If the "sansserif" package option is active use the \software{cmbright} font \cite{cmbright} and code adjusted from the \software{sansmathfonts} package \cite{sansmathfonts}.
% Ensure that "\mathsf" is italic as well as sans serif and sans for sans and sans serif documents, respectively.
% \begin{macrocode}
\ifhep@serif
\newcommand\hep@font@sf{cmbrm}
\DeclareMathAlphabet{\mathsf}{OML}{\hep@font@sf}{m}{it}
\SetMathAlphabet{\mathsf}{bold}{OML}{\hep@font@sf}{b}{it}
\else
\newcommand\hep@font@sf{lmr}
\newcommand\hep@font@text{lmss}
\newcommand\hep@font@math{cmbrm}
\newcommand\hep@font@symbol{cmsssy}
\newcommand\hep@font@extra{cmssex}
\newcommand\hep@font@amsa{ssmsa}
\newcommand\hep@font@amsb{ssmsb}
% \end{macrocode}
% Declare font substitutions.
% \begin{macrocode}
\DeclareFontSubstitution{OML}{\hep@font@math}{m}{it}
\ifhep@symbols\ifhep@minion\else
\DeclareFontSubstitution{OMS}{\hep@font@symbol}{m}{n}
\DeclareFontSubstitution{OMX}{\hep@font@extra}{m}{n}
\fi\fi
% \end{macrocode}
% Declare the symbol fonts.
% \begin{macrocode}
\DeclareSymbolFont{operators}{OT1}{\hep@font@text}{m}{n}
\DeclareSymbolFont{letters}{OML}{\hep@font@math}{m}{it}
\ifhep@symbols\ifhep@minion\else
\DeclareSymbolFont{symbols}{OMS}{\hep@font@symbol}{m}{n}
\DeclareSymbolFont{largesymbols}{OMX}{\hep@font@extra}{m}{n}
\fi\fi
% \end{macrocode}
% Set bold symbol fonts.
% \begin{macrocode}
\SetSymbolFont{operators}{bold}{OT1}{\hep@font@text}{b}{n}
\SetSymbolFont{letters}{bold}{OML}{\hep@font@math}{b}{it}
\ifhep@symbols\ifhep@minion\else
\SetSymbolFont{symbols}{bold}{OMS}{\hep@font@symbol}{b}{n}
\fi\fi
% \end{macrocode}
% Adjust the fonts loaded by the \software{amsfonts} \cite{amsfonts} and \software{esint} \cite{esint} packages.
% \begin{macrocode}
\ifhep@symbols\ifhep@minion\else
\DeclareSymbolFont{AMSa}{U}{\hep@font@amsa}{m}{n}
\DeclareSymbolFont{AMSb}{U}{\hep@font@amsb}{m}{n}
\fi\fi
\AtBeginDocument{%
\@ifpackageloaded{esint}{%
\DeclareSymbolFont{largesymbolsA}{U}{ssesint}{m}{n}
}{}
}
% \end{macrocode}
% Declare the symbol font alphabets.
% \begin{macrocode}
\DeclareSymbolFontAlphabet{\mathrm}{operators}
\DeclareSymbolFontAlphabet{\mathnormal}{letters}
\ifhep@minion\else
\DeclareSymbolFontAlphabet{\mathcal}{symbols}
\fi
% \end{macrocode}
% Declare "\mathit".
% \begin{macrocode}
\DeclareMathAlphabet{\mathit}{OML}{\hep@font@text}{m}{it}
\SetMathAlphabet\mathit{bold}{OML}{\hep@font@text}{bx}{it}
% \end{macrocode}
% Declare "\mathtt".
% \begin{macrocode}
% \DeclareMathAlphabet{\mathtt}{OT1}{cmtl}{m}{n}
% \end{macrocode}
% \begin{macrocode}
% \end{macrocode}
% Declare "\mathsf".
% \begin{macrocode}
\DeclareMathAlphabet{\mathsf}{OML}{\hep@font@sf}{m}{it}
\SetMathAlphabet{\mathsf}{bold}{OML}{\hep@font@sf}{bx}{it}
% \end{macrocode}
% \end{macro}
% End of "sansserif".
% \begin{macrocode}
\fi
% \end{macrocode}
%
% \begin{macro}{\mathbf}
% Load the \software{bm} package \cite{bm} for superior boldmath.
% Make math symbols bold whenever they appear in bold macros such as "\section"\marg{text}.
% \begin{macrocode}
\ifhep@symbols
\RequirePackage{bm}
\AtBeginDocument{\let\mathbf\bm}
\g@addto@macro\bfseries{\boldmath}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mathtt}
% \begin{macrocode}
\DeclareMathAlphabet{\mathtt}{OT1}{lmtt}{m}{n}
\SetMathAlphabet{\mathtt}{bold}{OT1}{lmtt}{bx}{n}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mathscr}
% Provid the "\mathscr" math script font from the \software{mathrsfs} package \cite{mathrsfs}.
% \begin{macrocode}
\DeclareMathAlphabet{\mathscr}{U}{rsfs}{m}{n}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\mathbb}
% Redefine the the "\mathbb" math blackboard style font according to the \prefix{sans}{serif} option with the font from the \software{dsfont} package \cite{dsfont}.
% \begin{macrocode}
\ifhep@minion
\DeclareMathAlphabet{\mathbb}{U}{%
\ifhep@serif dsrom\else dsss\fi%
}{m}{n}
\else
\ifhep@ams\else
\SetMathAlphabet{\mathbb}{normal}{U}{%
\ifhep@serif dsrom\else dsss\fi%
}{m}{n}
\fi
\fi
\fi
% \end{macrocode}
% \end{macro}
%
%
%
% \subsection{Font size} \label{sec:font size}
%
%<*package>
%
% Undefine previously defined font sizes and load the \hologo{LaTeX} font size file corresponding to the font size option.
% \begin{macrocode}
\ifhep@defaults\else
\def\hep@remove@pt#1pt{#1}
\edef\hep@pt@size{\expandafter\hep@remove@pt\hep@font}
\let\small\relax
\let\footnotesize\relax
\let\scriptsize\relax
\let\tiny\relax
\let\large\relax
\let\Large\relax
\let\LARGE\relax
\let\huge\relax
\let\Huge\relax
\input{size\hep@pt@size.clo}
\fi
% \end{macrocode}
%
% \section{Text}
%
% Load the \software{babel} package \cite{babel} for hyphenation and the recommended \software{csquotes} package \cite{csquotes}.
% \begin{macrocode}
\RequirePackage[\hep@lang]{babel}
\RequirePackage[autostyle]{csquotes}
% \end{macrocode}
%
% \begin{macro}{\underline}
% Load the \software{ulem} package \cite{ulem} for hyphenable underlined text.
% \begin{macrocode}
\RequirePackage[normalem]{ulem}
\let\underline\uline
% \end{macrocode}
% \end{macro}
%
%\begin{macro}{\vs}
% Load the \software{foreign} package \cite{foreign} in order to highlight abbreviations and vocabularies from foreign languages.
% Add the missing "\vs" command.
% \begin{macrocode}
\ifnum\pdf@strcmp{\hep@lang}{american}=0
\newcommand{\hep@lang@foreign}{USenglish}
\else
\ifnum\pdf@strcmp{\hep@lang}{USenglish}=0
\newcommand{\hep@lang@foreign}{USenglish}
\else
\newcommand{\hep@lang@foreign}{british}
\fi
\fi
\RequirePackage[all, \hep@lang@foreign]{foreign}
\DeclareRobustCommand\vs{\xperiodafter{{\foreignabbrfont{vs}}}}
% \end{macrocode}
% \end{macro}
%
% The \software{foreign} package relies on the \software{xspace} package \cite{xspace}.
% Ensure that "\xspace" is compatible with the "\enquote" macro from the \software{csquote} package.
% \begin{macrocode}
\xspaceaddexceptions{\csq@qclose@i}
% \end{macrocode}
%
%\begin{macro}{\no}
% Define the macro "\no"\marg{number} for the use of \textnumero\ with appropriate spacing.
% \begin{macrocode}
\newcommand{\no}[1]{\textnumero~#1}
% \end{macrocode}
% \end{macro}
%
%\begin{macro}{\software}
% Define a macro for software with optional version information "\software"\linebreak[1]\oarg{version}\linebreak[1]\marg{name}, using the \software{relsize} package \cite{relsize}.
% \begin{macrocode}
\RequirePackage{relsize}
\newcommand{\software}[2][\hspace{-\fontdimen2\font}]{%
{\smaller[.5]\textsc{#2}~#1}%
}
% \end{macrocode}
% \end{macro}
%
%
%<*package|title|bibliography>
%
% \begin{macro}{\online}
% \begin{macro}{\email}
% Define the "\online"\marg{text}\marg{url} macro combining the features of the "\href" and the "\url" macros.
% Define a macro for typesetting emails.
% \begin{macrocode}
\providecommand{\online}[2]{\ttfamily{#2}}%
\newcommand{\hep@email}[1]{\online{mailto:#1}{#1}}
\providecommand\email{\hep@email}
\AtEndOfPackage{\@ifpackageloaded{hyperref}{%
\renewcommand{\online}[2]{\href{#1}{\nolinkurl{#2}}}%
}{}
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%<*package>
%
% \begin{macro}{\prefix}
% Define the "\prefix"\marg{prefix}\marg{word} macro ensuring the correct linebreak in \prefix{prefix}{word}.
% \begin{macrocode}
\newcommand{\prefix}[2]{(#1\mbox{-)}\allowbreak #2}
% \end{macrocode}
% \end{macro}
%
% \subsection{Lists}
%
% Load the \software{enumitem} package \cite{enumitem}.
% \begin{macrocode}
\RequirePackage[inline]{enumitem}
% \end{macrocode}
%
% \begin{environment}{inlinelist}
% Define an inline list environment.
% \begin{macrocode}
\newlist{inlinelist}{enumerate*}{1}
\setlist*[inlinelist,1]{%
label=\roman*), itemjoin={,\ }, itemjoin*={, and\ }, after=.%
}
% \end{macrocode}
% \end{environment}
%
% \begin{environment}{enumdescript}
% Define an enumdescript list environment.
% \begin{macrocode}
\newlist{enum@descript}{enumerate}{2}
\setlist[enum@descript]{label=\arabic*.}
\newenvironment{enumdescript}[1][]{
\begin{enum@descript}[#1]
\let\hep@item\item
\renewcommand{\item}[2][]{
\ifx#1&\hep@item\else\hep@item[##1]\fi
\textbf{##2}\ifx##2\empty\else~\fi\@ifnextchar\par\@gobble\relax
}
}{\end{enum@descript}}
% \end{macrocode}
% \end{environment}
%
%
%<*package|bibliography>
%
% \begin{environment}{commalist}
% Define a commalist environment.
% \begin{macrocode}
\RequirePackage{xparse}
\ExplSyntaxOn
\NewDocumentEnvironment{commalist}{O{\space}+b}{
\hep@comma@list:n{#2}
}{#1}
\seq_new:N \hep@items@sequence
\cs_new_protected:Npn \hep@comma@list:n #1{
\seq_set_split:Nnn \hep@items@sequence{\item}{#1}
\seq_pop_left:NN \hep@items@sequence \l_tmpa_tl
\seq_use:Nnnn \hep@items@sequence{~and~}{,~}{,~and~}
}
\ExplSyntaxOff
% \end{macrocode}
% \end{environment}
%
%
%
% \section{Geometry}
%
%<*package>
%
% Load the \software{geometry} package \cite{geometry} and adjust the text width and height.
% This step must happen after readjusting the font size in \cref{sec:font size}.
% \begin{macrocode}
\ifhep@defaults\else
\RequirePackage{geometry}
\geometry{\hep@paper paper, includeheadfoot}
\if@twocolumn
\geometry{hscale=.85, vscale=.925, vmarginratio=1:1}
\geometry{headsep=2ex, footskip=6ex}
\setlength{\columnsep}{1.1em}
\else
\geometry{hscale=.75, vscale=.8, vmarginratio=3:4}
\fi
\fi
% \end{macrocode}
%
%\begin{macro}{\useparskip}
%\begin{macro}{\useparindent}
% Load the \software{parskip} package \cite{parskip} if requested and provide two commands switching between the two paragraph modes.
% \begin{macrocode}
\ifhep@parindent\else
\RequirePackage{parskip}
\newcommand{\useparskip}{%
\setlength{\parskip}{.5\baselineskip plus 2pt}%
\setlength{\parindent}{0pt}%
}
\newcommand{\useparindent}{%
\setlength{\parskip}{0pt}%
\setlength{\parindent}{15pt}%
\if@twocolumn\setlength\parindent{1em}
\else\setlength\parindent{1.5em}
\fi
}
\fi
% \end{macrocode}
% \end{macro}
% \end{macro}
%
%
%
% \section{Math}
%
%<*package|math>
%
% Load the \software{mathtools} package \cite{mathtools} which loads the \software{amsmath} package \cite{amsmath}.
% Allow page breaks within equations if necessary.
% Adjust the thick and med mu skips slightly.
% \begin{macrocode}
%\ifhep@physics
%
%<*package|math|acronyms>
%
% \begin{macro}{\mathdef}
% Define the "\mathdef"\marg{name}\oarg{arguments}\marg{macro} macro which \prefix{re}{defines} macros in math mode only.
% This macro is implemented using the \software{xparse} package \cite{xparse}.
% \begin{macrocode}
\RequirePackage{xparse}
\DeclareDocumentCommand{\mathdef}{mO{0}m}{%
\expandafter\let\csname hep@text\string#1\endcsname=#1
\expandafter\newcommand\csname hep@math\string#1\endcsname[#2]{#3}
\DeclareRobustCommand#1{%
\ifmmode
\expandafter\let\expandafter\next\csname%
hep@math\string#1\endcsname%
\else
\expandafter\let\expandafter\next\csname%
hep@text\string#1\endcsname%
\fi
\next
}%
}
% \end{macrocode}
% \end{macro}
%
%
%<*package|math>
%
% \begin{macro}{\i}
% Provide an upright imaginary unit in math mode.
% \begin{macrocode}
\AtBeginDocument{\mathdef{\i}{\operatorname{i}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\overline}
% Redefine "\overline" to be a text macro using the \software{ulem} package \cite{ulem}.
% Extend it as a math macro with the original definition from the \software{amsmath} package \cite{amsmath}.
% \begin{macrocode}
\RequirePackage{ulem}
\def\overline#1{{\renewcommand{\ULdepth}{-1.9ex}{}\uline{#1}}}
\DeclareRobustCommand{\over@line}[1]{\@@overline{#1}}
\mathdef{\overline}{\over@line}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\oset}
% Define a new overset macro "\oset"\oarg{offset}\marg{over}\marg{base}
% \begin{macrocode}
\newcommand{\oset}[3][-1pt]{%
\text{\raisebox{.2ex}{$\mathop{#3}\limits^{%
\vbox to#1{\kern-2\ex@\hbox{$\scriptscriptstyle#2$}\vss}%
}$}}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\overleftright}
% Define a over left right arrow "\overleftright"\marg{base}.
% \begin{macrocode}
\newcommand{\overleftright}[1]{\oset{\leftrightarrow}{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{eqnarray}
% Undefine the "eqnarray" environment if not prevented by package option.
% \begin{macrocode}
\ifhep@eqnarray\else
\let\eqnarray\@undefined
\let\endeqnarray\@undefined
\fi
% \end{macrocode}
% \end{macro}
%
% \subsection{Operators}
%
% \begin{macro}{\tr}
% \begin{macro}{\Tr}
% \begin{macro}{\rank}
% \begin{macro}{\erf}
% \begin{macro}{\Res}
% \begin{macro}{\sgn}
% \begin{macro}{\sgn}
% \begin{macro}{\diag}
% Provide the "\diag", "\sgn", and other operators.
% \begin{macrocode}
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\Tr}{Tr}
\DeclareMathOperator{\rank}{rank}
\DeclareMathOperator{\erf}{erf}
\DeclareMathOperator{\Res}{Res}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\diag}{diag}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\Re}
% \begin{macro}{\Im}
% Redefine the real and imaginary projectors.
% \begin{macrocode}
\let\Re\relax\DeclareMathOperator{\Re}{Re}
\let\Im\relax\DeclareMathOperator{\Im}{Im}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \subsubsection{Trigonometric functions}
%
% \begin{macrocode}
\let\cos\undefined\DeclareMathOperator{\cos}{cos\vphantom{i}}
\let\tan\undefined\DeclareMathOperator{\tan}{tan\vphantom{i}}
% \end{macrocode}
% \begin{macrocode}
\DeclareMathOperator{\arccsc}{arccsc}
\DeclareMathOperator{\arcsec}{arcsec}
\DeclareMathOperator{\arccot}{arccot}
% \end{macrocode}
% \begin{macrocode}
\DeclareMathOperator{\asin}{asin}
\DeclareMathOperator{\acos}{acos}
\DeclareMathOperator{\atan}{atan}
\DeclareMathOperator{\acsc}{acsc}
\DeclareMathOperator{\asec}{asec}
\DeclareMathOperator{\acot}{acot}
% \end{macrocode}
% \begin{macrocode}
\DeclareMathOperator{\csch}{csch}
\DeclareMathOperator{\sech}{sech}
% \end{macrocode}
%
% \subsection{Units and fractions}
%
% \begin{macro}{\unit}
% Load the \software{units} package \cite{units} which provides the "\units" and "\nicefrac" macros.
% Patch the "\unit" and "\unitfrac" macros to work with lining numerals using the \software{xpatch} package \cite{xpatch}.
% \begin{macrocode}
\RequirePackage{units}
\RequirePackage{xpatch}
\ifhep@lining\else
\xpatchcmd{\unit}{\else#1}{%
\else\ifthenelse{\boolean{mmode}}{#1}{\textl{#1}}%
}{}{}
\xpatchcmd{\unitfrac}{\else#1}{%
\else\ifthenelse{\boolean{mmode}}{#1}{\textl{#1}}%
}{}{}
\fi
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\inv}
% Provide a macro for the inverse, useful in combination with the unit macro in text mode.
% \begin{macrocode}
\newcommand{\inv}[2][1]{#2\ensuremath{^{-#1}}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\flatfrac}
% Flat fraction.
% \begin{macrocode}
\DeclarePairedDelimiterX{\hep@flatfrac}[2]{.}{.}{%
#1\delimsize/\makeleftdelim#2%
}
\NewDocumentCommand{\flatfrac}{somm}{%
\IfBooleanTF{#1}{%
\hep@flatfrac*{#3}{#4}%
}{%
\IfNoValueTF{#2}{\,\makeleftdelim#3/\makeleftdelim#4\,%
}{%
\hep@flatfrac[#2]{#3}{#4}%
}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\textfrac}
% Provide the "\textfrac" macro.
% \begin{macrocode}
\newcommand{\textfrac}[2]{\ensuremath{\nicefrac{\text{#1}}{\text{#2}}}}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Differentials and derivatives}
%
% \begin{macro}{\differential}
% \begin{macro}{\d}
% Provide a differential "\d".
% \begin{macrocode}
\newcommand{\makedifferential}[1]{\mathop{}\!#1}
\providecommand{\differentialsymbol}{d}
\newcommand{\differential}{\makedifferential\differentialsymbol}
\AtBeginDocument{\mathdef{\d}{\differential}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\makederivative}
% \begin{macrocode}
\newcommand\makederivative[2]{
\NewDocumentCommand{#1}{somso}{%
\IfBooleanTF{##4}{%
\IfBooleanTF{##1}{\nicefrac}{\frac}%
}{%
\IfBooleanTF{##1}{\flatfrac}{\dfrac}%
}{%
\makedifferential#2\IfValueT{##2}{^{##2}}\IfValueT{##5}{##5}%
}{%
\makedifferential#2{##3}\IfValueT{##2}{^{##2}}%
}%
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\derivative}
% \begin{macrocode}
\makederivative{\derivative}{d}
\newcommand\dv{\derivative}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\variation}
% \begin{macrocode}
\newcommand\variation{\makedifferential\delta}
\newcommand\var{\variation}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\functionalderivative}
% \begin{macrocode}
\makederivative{\functionalderivative}{\delta}
\newcommand\fdv{\functionalderivative}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\makepartialderivative}
% \begin{macrocode}
\RequirePackage{etoolbox}
\newcommand\makepartialderivative[2]{
\NewDocumentCommand{#1}{sO{}O{}msoo}{%
\IfBooleanTF{##5}{%
\IfBooleanTF{##1}{\nicefrac}{\frac}%
}{%
\IfBooleanTF{##1}{\flatfrac}{\dfrac}%
}{%
\makedifferential#2\IfValueTF{##7}{%
\ifblank{##2}{
\ifblank{##3}{^2}{^{\the\numexpr##3+1\relax}}%
}{%
\ifblank{##3}{%
^{\the\numexpr##2+1\relax}}{^{{\the\numexpr##2+##3\relax}}%
}%
}%
}{\IfValueT{##2}{^{##2}}}\IfValueT{##6}{##6}%
}{%
\makedifferential#2{##4}\IfValueT{##2}{^{##2}}%
\IfValueT{##7}{#2##7\IfValueT{##3}{^{##3}}}%
}%
}
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\partialderivative}
% \begin{macrocode}
\makepartialderivative{\partialderivative}{\partial}
\newcommand\pdv{\partialderivative}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\cancel}
% \begin{macro}{\slashed}
% Additionally, load the \software{cancel} \cite{cancel} and \software{slashed} \cite{slashed} packages which provide the "\cancel" and "\slashed" macros.
% \begin{macrocode}
\RequirePackage{cancel}
\RequirePackage{slashed}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \subsection{Paired delimiters}
%
% \begin{macro}{\left}
% \begin{macro}{\right}
% Load the \software{mleftright} package \cite{mleftright} and adjust the spacing around "\left" and "\right".
% \begin{macrocode}
\RequirePackage{mleftright}
\mleftright
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\abs}
% \begin{macro}{\norm}
% \begin{macro}{\pnorm}
% Absolute value and norm.
% \begin{macrocode}
\newcommand{\noargumentsymbol}{\:\cdot\:}
\newcommand{\optionalargument}[1]{\ifblank{#1}{\noargumentsymbol}{#1}}
\DeclarePairedDelimiterX\abs[1]\lvert\rvert{\optionalargument{#1}}
\DeclarePairedDelimiterX\norm[1]\lVert\rVert{\optionalargument{#1}}
\DeclarePairedDelimiterXPP\hep@pnorm[2]{}\lVert\rVert{_{#1}}{#2}
\NewDocumentCommand{\pnorm}{som}{%
\IfValueTF{#2}{%
\IfBooleanTF{#1}{\hep@pnorm*}{\hep@pnorm}{#2}%
}{%
\IfBooleanTF{#1}{\norm*}{\norm}%
}{\optionalargument{#3}}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \begin{macro}{\order}
% Order symbol and macro.
% \begin{macrocode}
\providecommand{\ordersymbol}{\mathcal{O}}
\DeclarePairedDelimiterXPP\order[1]{\ordersymbol}(){}{#1}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\evaluated}
% \begin{macro}{\eval}
% Vertical evaluation bar
% \begin{macrocode}
\DeclarePairedDelimiter{\hep@evaluated}{.}{\rvert}
\NewDocumentCommand{\evaluated}{som}{%
\IfBooleanTF{#1}{%
\hep@evaluated*{#3}%
}{%
\IfNoValueTF{#2}{#3\rvert}{\hep@evaluated[#2]{#3}}%
}%
}
\newcommand\eval{\evaluated}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \subsubsection{Set and Probability}
%
% \begin{macro}{\midbar}
% \begin{macrocode}
\newcommand\makeleftdelim{\mathopen{}}
\providecommand{\midbar}[1][]{%
\nonscript\:#1\vert\allowbreak\nonscript\:\makeleftdelim%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\suchthat}
% \begin{macro}{\set}
% \begin{macrocode}
\providecommand\suchthat{\midbar}
\DeclarePairedDelimiterX\set[1]\{\}{%
\renewcommand\suchthat{\midbar[\delimsize]}#1%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \begin{macro}{\probabilitysymbol}
% \begin{macro}{\given}
% \begin{macro}{\Pr}
% \begin{macrocode}
\providecommand{\probabilitysymbol}{\operatorname{Pr}}
\providecommand\given{\midbar}
\DeclarePairedDelimiterXPP\hep@Pr[1]{%
\probabilitysymbol}(){}{%
\renewcommand\given{\midbar[\delimsize]}#1%
}
\let\Pr\relax
\NewDocumentCommand{\Pr}{so}{%
\IfValueTF{#2}{%
\IfBooleanTF{#1}{\hep@Pr*}{\hep@Pr}{#2}%
}{%
\probabilitysymbol%
}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \subsubsection{Commutators}
%
% \begin{macro}{\innerproduct}
% \begin{macro}{\poissonbracket}
% \begin{macro}{\commutator}
% \begin{macro}{\anticommutator}
% Poissonbracket, commutator and anti-commutator.
% \begin{macrocode}
\DeclarePairedDelimiterX\innerproduct[2]{%
\langle}{\rangle}{\optionalargument{#1},\optionalargument{#2}%
}
\DeclarePairedDelimiterX\poissonbracket[2]{%
\lbrace}{\rbrace}{\optionalargument{#1},\optionalargument{#2}%
}
\newcommand\pb{\poissonbracket}
\DeclarePairedDelimiterX\commutator[2]{%
\lbrack}{\rbrack}{\optionalargument{#1},\optionalargument{#2}%
}
\newcommand\comm{\commutator}
\DeclarePairedDelimiterX\anticommutator[2]{%
\lbrace}{\rbrace}{\optionalargument{#1},\optionalargument{#2}%
}
\newcommand\acomm{\anticommutator}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \subsubsection{Bra-ket notation}
%
% \begin{macrocode}
\providecommand\braketspace{\mskip1mu}
\newcommand\hep@midvert{%
\braketspace\delimsize\vert\braketspace\makeleftdelim%
}
% \end{macrocode}
%
% \begin{macro}{\braket}
% \begin{macrocode}
\DeclarePairedDelimiterX\braket[2]{\langle}{\rangle}{\braketspace#1\hep@midvert#2\braketspace}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\bra}
% \begin{macrocode}
\DeclarePairedDelimiterXPP\hep@bra[1]{%
}{\langle}{\rvert}{\braketspace}{\braketspace#1\braketspace%
}
\NewDocumentCommand{\bra}{smt\ket sgt\ketbra sgg}{%
\IfBooleanTF{#6}{%
\IfBooleanTF{#1}{\braket*{#2}{#8}}{\braket{#2}{#8}}%
\IfBooleanTF{#7}{\bra*{#9}}{\bra{#9}}%
}{
\IfBooleanTF{#3}{%
\IfBooleanTF{#1}{\braket*}{%
\IfBooleanTF{#4}{\braket*}{\braket}}{#2}{#5%
}%
}{%
\IfBooleanTF{#1}{\hep@bra*}{\hep@bra}{#2}%
}%
}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ket}
% \begin{macrocode}
\DeclarePairedDelimiterXPP\ket[1]{%
\braketspace}{\lvert}{\rangle}{}{\braketspace\makeleftdelim#1\braketspace%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\ketbra}
% \begin{macrocode}
\NewDocumentCommand{\ketbra}{smm}{%
\IfBooleanTF{#1}{%
\ket*{#2}\bra*{#3}%
}{%
\ket{#2}\bra{#3}%
}%
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\matrixelement}
% \begin{macrocode}
\DeclarePairedDelimiterX\matrixelement[3]{%
\langle}{\rangle}{\braketspace#1\hep@midvert#2\hep@midvert#3\braketspace%
}
\newcommand\matrixel{\matrixelement}
\newcommand\mel{\matrixelement}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\expectationvalue}
% \begin{macrocode}
\DeclarePairedDelimiterX\hep@expvalue[1]{\langle}{\rangle}{\braketspace#1\braketspace}
\NewDocumentCommand{\expectationvalue}{som}{%
\IfNoValueTF{#2}{%
\IfBooleanTF{#1}{\hep@expvalue*}{\hep@expvalue}{#3}%
}{%
\IfBooleanTF{#1}{\matrixelement*}{\matrixelement}{#2}{#3}{#2}%
}%
}
\newcommand\ev{\expectationvalue}
\newcommand\vev[1]{\expectationvalue[0]{#1}}
% \end{macrocode}
% \end{macro}
% End of "physics" conditional.
% \begin{macrocode}
%\fi
% \end{macrocode}
%
%
%
% \section{Floats}
%
%<*package|floats>
%
% \begin{macrocode}
%\newif\ifhep@manualplacement\hep@manualplacementfalse
% \end{macrocode}
%
% Adjust the \hologo{LaTeX} float placement defaults
% \begin{macrocode}
\setcounter{bottomnumber}{0} % 1
\setcounter{topnumber}{1} % 2
\setcounter{dbltopnumber}{1} % 2
\renewcommand{\topfraction}{.9} % .7
\renewcommand{\dbltopfraction}{.9} % .7
\renewcommand{\textfraction}{.1} % .2
\renewcommand{\floatpagefraction}{.8} % .5
% \end{macrocode}
%
% \begin{environment}{figure}
% \begin{environment}{table}
% Center the content of "figure" and "table" environments.
% Ignore the manual placement if the "manualplacement" option is set to false.
% \begin{macrocode}
\let\hep@figure\figure%
\let\end@hep@figure\endfigure%
\let\hep@table\table%
\let\end@hep@table\endtable%
\ifhep@manualplacement%
\renewenvironment{figure}[1][tbp]{%
\hep@figure[#1]\centering%
}{\end@hep@figure}%
\renewenvironment{table}[1][tbp]{%
\hep@table[#1]\centering%
}{\end@hep@table}%
\else%
\renewenvironment{figure}[1][]{%
\hep@figure\centering%
}{\end@hep@figure}%
\renewenvironment{table}[1][]{%
\hep@table\centering%
}{\end@hep@table}
\fi%
% \end{macrocode}
% \end{environment}
% \end{environment}
%
%
%
% \subsection{Sub-floats}
%
%<*package>
%
% \begin{macro}{\ifhep@journal}
% Define a new journal conditional.
% \begin{macrocode}
\newif\ifhep@journal
\ifhep@sissa\hep@journaltrue
\else
\ifhep@revtex\hep@journaltrue
\else
\ifhep@pos\hep@journaltrue
\else
\ifhep@springer\hep@journaltrue
\else\hep@journalfalse
\fi
\fi
\fi
\fi
% \end{macrocode}
% \end{macro}
%
% Prevent the \software{caption} package \cite{caption} from complaining about the journal classes and packages.
% \begin{macrocode}
\ifhep@journal
\setlength\abovecaptionskip{\f@size\p@}
\setlength\belowcaptionskip{0\p@}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip%
}
\fi
% \end{macrocode}
%
%
%<*package|floats>
%
% Load the \software{subcaption} package \cite{subcaption}.
% Provide the old "\subcaption@minipage" macro.
% \begin{macrocode}
\RequirePackage[subrefformat=parens]{subcaption}
\captionsetup{font=small}
\captionsetup[sub]{font=small}
\providecommand*\subcaption@minipage[2]{%
\minipage#1{#2}\setcaptionsubtype\relax%
}
% \end{macrocode}
% \begin{environment}{panels}
% \begin{macro}{\panel}
% Define the "panels" environment and the "\panel" macro.
% \begin{macrocode}
\newcommand{\hep@panels@space}{20}
\newenvironment{panels}[2][b]{%
% \end{macrocode}
% Define an internal macro for global behaviour.
% \begin{macrocode}
\newcommand{\begin@subcaption@minipage}[2][b]{%
\caption@withoptargs\subcaption@minipage[##1]{##2}%
\centering\vskip 0pt%
}
% \end{macrocode}
% Define the "\panel" macro for the case that the number of panels is given.
% \begin{macrocode}
\ifdim#2pt>1pt%
\newcommand{\hep@panel@space}{%
(1-#2+\hep@panels@space)/\hep@panels@space%
}%
\newcommand{\panel}[1][b]{%
\endminipage\hfill\begin@subcaption@minipage[#1]{%
\linewidth/#2*\hep@panel@space%
}%
}%
\begin@subcaption@minipage[#1]{\linewidth/#2*\hep@panel@space}%
% \end{macrocode}
% Define the "\panel" macro for the case that the width of the panel is given.
% \begin{macrocode}
\else%
\newcommand{\panel}[2][b]{%
\endminipage\hfill\begin@subcaption@minipage[#1]{##2\linewidth}%
}%
\begin@subcaption@minipage[#1]{#2\linewidth}%
\fi%
}{\endminipage}
% \end{macrocode}
% \end{macro}
% \end{environment}
%
%
%<*package>
%
% Reajust the captions to the revtex class using the \software{ragged2e} package \cite{ragged2e}.
% \begin{macrocode}
\ifhep@revtex
\RequirePackage{ragged2e}
\DeclareCaptionFormat{revtex}{#1#2\justifying{#3}}
\captionsetup{font=small, format=revtex}
\captionsetup[sub]{font=footnotesize, format=plain}
\renewcommand{\figurename}{Figure}
\renewcommand{\tablename}{Table}
\fi
% \end{macrocode}
%
%
%
% \subsection{Tables}
%
%<*package|floats>
%
% \begin{environment}{tabular}
% Enhance tabulars with the \software{booktabs} and \software{multirow} packages \cite{booktabs, multirow}.
% \begin{macrocode}
\RequirePackage{booktabs}
\RequirePackage{multirow}
% \end{macrocode}
% \end{environment}
% \subsection{Figures}
%
% \begin{macro}{\graphic}
% Provide the "\graphic" macro for the inclusion of figures using the \software{graphicx} package \cite{graphicx}.
% \begin{macrocode}
\RequirePackage{graphicx}
\providecommand{\tikzsetnextfilename}[1]{}
\newcommand{\graphic}[2][1]{\tikzsetnextfilename{#2}{%
\centering\includegraphics[width=#1\linewidth]{#2}\par%
}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\graphics}
% Provide the "\graphics" macro for the inclusion of figures located in a subfolder.
% \begin{macrocode}
\newcommand{\graphics}[1]{\graphicspath{{./#1/}}}
% \end{macrocode}
% \end{macro}
%
%
%
% \section{Title page}
%
%<*package|title>
%
% Redefine previous macros just for the title package.
% \begin{macrocode}
\newif\ifhep@first%
% \end{macrocode}
%
%
%<*package>
%
% Define title internal conditionals outside of main conditional.
% TODO: replace this hack
% Begin of "title" conditional.
% \begin{macrocode}
\newif\ifnewaffil%
\ifhep@title
% \end{macrocode}
%
%
%<*package|title>
%
% \begin{macro}{\hep@multi@ref}
% Transform reference list to list of references.
% \begin{macrocode}
\newcommand{\hep@multi@ref}[1]{%
\hep@firsttrue%
\forcsvlist{%
\ifhep@first\hep@firstfalse\else\textsuperscript,\fi\ref%
}{#1}%
}
% \end{macrocode}
% \end{macro}
%
% Redefine the email macro for the title page.
% \begin{macrocode}
\renewcommand{\email}[2][]{\unskip\thanks[#1]{\hep@email{#2}}}%
\AtBeginDocument{
\let\hep@maketitle\maketitle
\renewcommand\maketitle{\hep@maketitle\let\email\hep@email}
}
% \end{macrocode}
%
% \subsection{Preprint and title}
%
% \subsubsection{Preprint}
%
% \begin{macro}{\preprintfont}
% Define the "\preprintfont" macro.
% \begin{macrocode}
\let\hep@preprint@font\relax
\newcommand{\preprintfont}[1]{\def\hep@preprint@font{#1}}
\preprintfont{\scshape\small}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\preprint}
% Define the "\preprint" macro using the \software{varwidth} package \cite{varwidth}.
% \begin{macrocode}
\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}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\placepreprint}
% Places a preprint number in the top right corner of the title page using the \software{atbegshi} \cite{atbegshi} and \software{picture} \cite{picture} packages.
% \begin{macrocode}
%\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}
}
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Series}
%
% \begin{macro}{\series}
% Define a series title.
% \begin{macrocode}
\newcommand{\preseries}[1]{\def\hep@pre@series{#1}}
\newcommand{\series}[1]{\def\hep@series{#1}}
\newcommand{\postseries}[1]{\def\hep@post@series{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\seriesfont}
% Allow to change the fontface of the series title.
% \begin{macrocode}
\let\hep@series@font\relax
\newcommand{\seriesfont}[1]{\def\hep@series@font{#1}}
% \end{macrocode}
% \end{macro}
%
% Set the default series title layout.
% \begin{macrocode}
\preseries{\begin{center}\Large\hep@series@font}
\postseries{\par\end{center}}
% \end{macrocode}
%
% \subsubsection{Title}
%
% Extend the title using the \software{titling} package \cite{titling}.
% Fix the footnote indent.
% \begin{macrocode}
\RequirePackage{titling}
\setlength{\thanksmarkwidth}{1.5em}
% \end{macrocode}
%
% \begin{macro}{\maketitlehooka}
% Place the preprint and the series title using "\maketitlehooka".
% \begin{macrocode}
\renewcommand{\maketitlehooka}{%
\placepreprint\vspace{-\bigskipamount}%
\@ifundefined{hep@series}{}{%
\hep@pre@series\hep@series\hep@post@series%
}%
\vspace{-\bigskipamount}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\titlefont}
% Allow to change the fontface of the the title.
% \begin{macrocode}
\let\hep@title@font\relax
\newcommand{\titlefont}[1]{\def\hep@title@font{#1}}
% \end{macrocode}
% \end{macro}
% Set default title layout.
% \begin{macrocode}
\pretitle{\begin{center}\LARGE\hep@title@font}
\posttitle{\par\end{center}}
% \end{macrocode}
% \subsubsection{Subtitle}
%
% \begin{macro}{\subtitle}
% Define a subtitle.
% \begin{macrocode}
\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}}
% \end{macrocode}
% \end{macro}
% \begin{macro}{\subtitlefont}
% Allow to change the fontface of the subtitle.
% \begin{macrocode}
\let\hep@subtitle@font\relax
\newcommand{\subtitlefont}[1]{\def\hep@subtitle@font{#1}}
% \end{macrocode}
% \end{macro}
%
% Set default subtitle layout.
% \begin{macrocode}
\presubtitle{\begin{center}\Large\hep@subtitle@font}
\postsubtitle{\par\end{center}}
% \end{macrocode}
%
% \subsection{Authors and Editors}
%
% \subsubsection{Editors}
%
% Define editors, similar to authors using the \software{authblk} package.
% Enable the handling of multiple authors with different affiliations using the \software{authblk} package \cite{authblk}.
% \begin{macrocode}
\RequirePackage{authblk}
\newcounter{editors}
\newcommand\hep@editorlist{}
\newcommand\hep@editors{}
% \end{macrocode}
%
% \begin{macro}{\editor}
% Copy of the "authblk" author code adjusted for editors.
% \begin{macrocode}
\newcommand\editor[2][]{%
\ifnewaffil%
\addtocounter{affil}{1}%
\edef\AB@thenote{\arabic{affil}}%
\fi%
\if\relax#1\relax%
\def\AB@note{\AB@thenote}%
\else%
\def\AB@note{#1}\setcounter{Maxaffil}{0}%
\fi%
\ifnum\value{editors}>1\relax%
\@namedef{@sep\number\c@editors}{\Authsep}%
\fi%
\addtocounter{editors}{1}%
\begingroup%
\let\protect\@unexpandable@protect \let\and\AB@pand%
\def\thanks{\protect\thanks}\def\footnote{\protect\footnote}%
\@temptokena=\expandafter{\hep@editors}{%
\def\\{%
\protect\\[\@affilsep]\protect\Affilfont\protect\AB@resetsep%
}%
\xdef\hep@editor{\AB@blk@and#2}%
\ifnewaffil%
\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}%
\xdef\hep@editors{\the\@temptokena\AB@blk@and}%
\else%
\xdef\hep@editors{\the\@temptokena\AB@as\AB@au@str}%
\global\let\AB@las\AB@lasx\gdef\AB@lasx{\protect\Authands}%
\gdef\AB@as{\Authsep}%
\fi%
\gdef\AB@au@str{#2}%
}%
\@temptokena=\expandafter{\hep@editorlist}%
\let\\=\editorcr%
\xdef\hep@editorlist{%
\the\@temptokena%
\protect\@nameuse{@sep\number\c@editors}%
\protect\Authfont#2%
\if\relax#1\relax\else%
\protect\hep@multi@ref{\AB@note}%
\fi%
}%
\endgroup%
\ifnum\value{editors}>2\relax%
\@namedef{@sep\number\c@editors}{\Authands}%
\fi%
\newaffilfalse%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\editorfont}
% Allow to change the fontface of the editors.
% \begin{macrocode}
\let\hep@editor@font\relax
\newcommand{\editorfont}[1]{\def\hep@editor@font{#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\preditor}
% \begin{macro}{\postditor}
% Set editor style.
% \begin{macrocode}
\newcommand{\preeditor}[1]{\def\hep@pre@editor{#1}}
\newcommand{\posteditor}[1]{\def\hep@post@editor{#1}}
\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{\end{tabular}\par\end{center}}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\maketitlehookb}
% Show subtitle and editor.
% \begin{macrocode}
\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
}
% \end{macrocode}
% \end{macro}
%
% \subsubsection{Authors}
%
% \begin{macro}{\author}
% Allow absent author field.
% \begin{macrocode}
% \author{}
% \end{macrocode}
% \end{macro}
%
% Switch authblk to a label ref system for affiliations.
% \begin{macrocode}
%\RequirePackage{xpatch}
\xpatchcmd{\author}{%
\protect\Authfont#2\AB@authnote{\AB@note}%
}{%
\protect\Authfont#2%
\if\relax#1\relax\else\unskip\protect\hep@multi@ref{\AB@note}\fi%
}{}{}
% \end{macrocode}
%
% \begin{macro}{\authorfont}
% Allow to change the fontface of the individual parts of the title.
% \begin{macrocode}
\let\hep@author@font\relax
\newcommand{\authorfont}[1]{\def\hep@author@font{#1}}
\renewcommand\Authfont{\hep@author@font}
% \end{macrocode}
% \end{macro}
%
% Set default author fontface.
% \begin{macrocode}
\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}}
% \end{macrocode}
%
% \subsubsection{Affiliation}
%
% Patch the "\affiliation" macro to comply with the label ref system.
% \begin{macrocode}
\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%
}{}{}
% \end{macrocode}
%
% \begin{macro}{\affiliationfont}
% Allow to change the fontface of affiliation.
% \begin{macrocode}
\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
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\affiliation}
% Define the "\affiliation" macro, ensure that linebreaks happen after a comma.
% \begin{macrocode}
\newcommand\hep@penalty{\if@twocolumn85\else50\fi}
\newcommand\hep@active@comma{,\penalty-\hep@penalty\relax}
\newcommand\hep@cat@comma@active{\catcode`\,\active}
{\hep@cat@comma@active\gdef,{\hep@active@comma}}
\newcommand\hep@affil[1]{%
\endgroup\@flushglue=0pt plus .5\linewidth\affil{#1}%
}
\def\hep@affil@opt[#1]#2{%
\endgroup\@flushglue=0pt plus .5\linewidth\affil[#1]{#2}%
}
\DeclareRobustCommand\hep@affiliation{%
\@ifnextchar[{\hep@affil@opt}{\hep@affil}%
}
\newcommand{\affiliation}{%
\begingroup\hep@cat@comma@active\hep@affiliation%
}
% \end{macrocode}
% \end{macro}
%
% \subsection{Date and Abstract}
%
% \subsubsection{Date}
%
% \begin{macro}{\date}
% Allow absent date field.
% \begin{macrocode}
\date{\vspace{-4ex}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\datefont}
% Allow to change the fontface of the individual parts of the title.
% \begin{macrocode}
\let\hep@date@font\relax
\newcommand{\datefont}[1]{\def\hep@date@font{#1}}
% \end{macrocode}
% \end{macro}
%
% Set the default "date" fontface.
% \begin{macrocode}
\predate{\begin{center}\hep@date@font}
\postdate{\par\end{center}}
% \end{macrocode}
%
% \subsubsection{Abstract}
%
% \begin{environment}{abstract}
% Adjust the "abstract" environment to not start with indentation.
% \begin{macrocode}
\@ifundefined{abstract}{}{%
\let\hep@abstract\abstract%
\renewcommand\abstract{\hep@abstract\noindent\ignorespaces}%
% \end{macrocode}
% \end{environment}
% \begin{environment}{abstract*}
% Add a "abstract*" environment for two column mode taking also care of placing the title using the \software{environ} \cite{environ} and \software{abstract} \cite{abstract} packages.
% \begin{macrocode}
\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
}
% \end{macrocode}
% \end{environment}
%
% \subsection{Thanks}
%
% \begin{macro}{\thanks} Redefine thank to have a optional argument for a reference label.
% \begin{macrocode}
\let\hep@thanks\thanks
\AtEndDocument{\let\thanks\hep@thanks}
% \AddToHook{begindocument/begin}{\let\thanks\hep@thanks}
\DeclareRobustCommand\thanks[2][]{%
\AfterEndPreamble{%
% \AddToHook{begindocument/end}{%
\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%
}%
}
% \end{macrocode}
% \end{macro}
%
%
%<*package>
%
% End of "title" conditional.
% \begin{macrocode}
\fi
% \end{macrocode}
% \section{Bibliography}
%
% Check if bibliography management is requested.
% \begin{macrocode}
\ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else
% \end{macrocode}
%
%
%<*package|bibliography>
%
% \begin{macrocode}
%\def\hep@bibliography{numeric-comp}
%\newif\ifhep@journal\hep@journalfalse
% \end{macrocode}
%
% \begin{macro}{\bibliography}
% Load the \software{biblatex} package \cite{biblatex} with the datamodel defined in \cref{sec:data model}.
% \begin{macrocode}
\RequirePackage[style=\hep@bibliography, datamodel=hep-paper]{biblatex}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{hep-paper}
% Provide the "\DeclareSortingTemplate" macro for older "biblatex" installations.
% Define a new sorting template that sorts only multi key "\cite" entries according to their date and leaves the rest of the bibliography entries in the order they appear in the text.
% \begin{macrocode}
\providecommand{\DeclareSortingTemplate}{\DeclareSortingScheme}
\DeclareSortingTemplate{hep-paper}{
\sort{\citeorder}
\sort[final]{\field{sortkey}}
\sort{\field{sortyear} \field{year} \literal{9999}}
\sort{\field{month}}
\sort{\field{eprint} \field{doi}}
\sort{\field{sorttitle} \field{title}}
\sort{\field{subtitle} \field{volume}}
}
% \end{macrocode}
% \end{macro}
%
% Use the new sorting scheme and abbreviat all first names.
% \begin{macrocode}
\ExecuteBibliographyOptions{
sorting=hep-paper,
safeinputenc,
giveninits=true,
maxbibnames=7
}
% \end{macrocode}
%
% Shrink the biblography in two column mode.
% \begin{macrocode}
\ifhep@journal\else
\if@twocolumn
\AtBeginBibliography{\small}
\setlength\biblabelsep{\labelsep}
\fi
\fi
% \end{macrocode}
%
% \begin{macro}{translationof}
% Redefine the "translationof" string to fit better to documents without a original title.
% \begin{macrocode}
\DefineBibliographyStrings{english}{translationof={Original}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{erratum}
% Add new bibliography string \enquote{Erratum} for the use in the "relatedtype" field.
% \begin{macrocode}
\NewBibliographyString{erratum,erratums}
\DefineBibliographyStrings{english}{erratum={Erratum},erratums={Errata}}
\providecommand{\relateddelimerratum}{\addsemicolon\space}
% \end{macrocode}
% \end{macro}
%
% Activate the Oxford comma when using "british" and separate title and subtitle with a colon.
% \begin{macrocode}
\DefineBibliographyExtras{british}{\def\finalandcomma{\addcomma}}
\renewcommand{\subtitlepunct}{\addcolon\addspace}
% \end{macrocode}
%
% \begin{macro}{\printbibliography}
% Allow the bibliography to be printed sloppy
% \begin{macrocode}
\let\hep@printbibliography\printbibliography
\renewcommand{\printbibliography}{\sloppy\hep@printbibliography}
% \end{macrocode}
% \end{macro}
% \subsection{Sourcemap}
%
% \begin{macro}{\reg@exp@one}
% \begin{macro}{\reg@exp@two}
% \begin{macro}{\reg@exp@url}
% \begin{macro}{\reg@exp@pmc}
% Define regular expressions in order to deal with inconsistent journal title and volume naming as well as \URL protocols and the PMCID.
% \begin{macrocode}
\newcommand{\reg@exp@one}{\regexp{\A(\p{L}+)?\d+(\p{L}+)?\Z}}
\newcommand{\reg@exp@two}{\regexp{\A(\p{L}+)?(\d+)(\p{L}+)?\Z}}
\newcommand{\reg@exp@url}{\regexp{\A(ht|f)tp(s)?:\/\/}}
\newcommand{\reg@exp@pmc}{\regexp{\A(PMC)?}}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\DeclareSourcemap}
% Use the "\DeclareSourcemap" feature.
% \begin{macrocode}
\DeclareSourcemap{%
\maps[datatype=bibtex, overwrite=true]{%
% \end{macrocode}
% \begin{macro}{collaboration}
% Read the collaboration information if present.
% \begin{macrocode}
\map{%
\step[fieldsource=Collaboration, final=true]%
\step[fieldset=collaboration, origfieldval, final=true]
}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{reportnumber}
% Read the pre-print information if present.
% \begin{macrocode}
\map{%
\step[fieldsource=reportNumber, final=true]%
\step[fieldset=reportnumber, origfieldval, final=true]
}%
% \end{macrocode}
% \end{macro}
% \begin{macro}{journal}
% Move letters from the volume field to the journal field.
% \begin{macrocode}
\map[overwrite]{
\pertype{article}
\step[fieldsource=volume, match=\reg@exp@one, final]
\step[fieldsource=volume, match=\reg@exp@two, replace={$2}]
\step[fieldsource=journal, fieldtarget=journaltitle]
\step[fieldset=journaltitle, fieldvalue={\space$1$2}, append=true]
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{url}
% Remove the protocol from \URL.
% \begin{macrocode}
\map{
\step[fieldsource=url, final=true]
\step[fieldset=protocollessurl, origfieldval, final=true]
\step[fieldsource=protocollessurl, match=\reg@exp@url, replace={}]
}
% \end{macrocode}
% \end{macro}
% \begin{macro}{pmc}
% Remove the PMC from the PMCID.
% \begin{macrocode}
\map{
\step[fieldsource=pmcid, final=true]
\step[fieldset=pmc, origfieldval, final=true]
\step[fieldsource=pmc, match=\reg@exp@pmc, replace={}]
}
}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\letbibmacro}
% Provide the "\letbibmacro" macro for old "biblatex" installations.
% \begin{macrocode}
\providecommand{\letbibmacro}[2]{\csletcs{abx@macro@#1}{abx@macro@#2}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{collaboration}
% Execute the author macro even if only the collaboration information if present and override the author information with collaboration information if present.
% \begin{macrocode}
\renewbibmacro*{author/translator+others}{%
\ifboolexpr{
test \ifuseauthor and (
not test {\ifnameundef{author}} or
not test {\iffieldundef{collaboration}}
)
}
{\usebibmacro{author}}
{\usebibmacro{translator+others}}
}
\letbibmacro{hep@bib@author}{author}
\renewbibmacro*{author}{%
\iffieldundef{collaboration}{%
\usebibmacro{hep@bib@author}}{\textit{\printfield{collaboration}}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{In:}
% Remove spurious \enquote{In:} if no journal is present.
% \begin{macrocode}
\renewbibmacro*{in:}{%
\iffieldundef{journaltitle}{}{\printtext{\bibstring{in}\intitlepunct}}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{reportnumber}
% Print the "reportnumber" as commalist
% \begin{macrocode}
%\RequirePackage{relsize}
\DeclareFieldFormat{reportnumber}{%
\edef\commalistbody{\forcsvfield{%
\egroup\noexpand\item\unexpanded{\bgroup\smaller[.5]\textsc}
}{reportnumber}}%
\expandafter\commalist\commalistbody\egroup\endcommalist%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{url}
% Show \URLs without the protocol.
% \begin{macrocode}
\DeclareFieldFormat{url}{%
\mkbibacro{URL}\addcolon\space\online{#1}{\thefield{protocollessurl}}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bib@online}
% Private "\bib@online" macro
% \begin{macrocode}
\newcommand{\bib@online}[2]{%
\ifhyperref{\online{#1}{#2}}{\nolinkurl{#2}}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{pmid}
% \begin{macro}{pmcid}
% Present PubMed IDs.
% \begin{macrocode}
\DeclareFieldFormat{pmid}{%
\mkbibacro{PM}\addcolon\space%
\bib@online{https://www.ncbi.nlm.nih.gov/pubmed/#1}{#1}%
}
\DeclareFieldFormat{pmc}{%
\mkbibacro{PMC}\addcolon\space%
\bib@online{https://www.ncbi.nlm.nih.gov/pmc/articles/PMC#1}{#1}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{pmcid}
% \begin{macro}{pmid}
% \begin{macro}{reportnumber}
% Add the pre-print and PubMed information if present.
% \begin{macrocode}
\letbibmacro{hep-doi+eprint+url}{doi+eprint+url}
\renewbibmacro*{doi+eprint+url}{%
\usebibmacro{hep-doi+eprint+url}
\iffieldundef{pmc}{%
\iffieldundef{pmid}{}{\printfield{pmid}\newunit}%
}{\printfield{pmc}\newunit}
\iffieldundef{reportnumber}{}{%
\newunitpunct\textnumero\intitlepunct%
\printfield{reportnumber}\newunit%
}%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \subsection{Eprints}
%
% \begin{macro}{\new@eprint}
% Private "\new@eprint" macro
% \begin{macrocode}
\NewDocumentCommand{\new@eprint}{smm}{
\DeclareFieldFormat{eprint:#2}{%
\newcommand{\@path}{\IfBooleanT{#1}{\thefield{eprintclass}/}##1}%
#2\addcolon\space\bib@online{#3/\@path}{\@path}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{CTAN}
% Add CTAN as a eprint option
% \begin{macrocode}
\new@eprint{CTAN}{https://ctan.org/pkg}
\DeclareFieldAlias{eprint:ctan}{eprint:CTAN}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{GitHub}
% Add GitHub as a eprint option
% \begin{macrocode}
\new@eprint*{GitHub}{https://github.com}
\DeclareFieldAlias{eprint:github}{eprint:GitHub}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{GitLab}
% Add GitLab as a eprint option
% \begin{macrocode}
\new@eprint*{GitLab}{https://gitlab.com}
\DeclareFieldAlias{eprint:gitlab}{eprint:GitLab}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{Bitbucket}
% Add Bitbucket as a eprint option
% \begin{macrocode}
\new@eprint*{Bitbucket}{https://bitbucket.org}
\DeclareFieldAlias{eprint:bitbucket}{eprint:Bitbucket}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{Launchpad}
% Add Launchpad as a eprint option
% \begin{macrocode}
\new@eprint{Launchpad}{https://launchpad.net}
\DeclareFieldAlias{eprint:launchpad}{eprint:Launchpad}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{SourceForge}
% Add SourceForge as a eprint option
% \begin{macrocode}
\new@eprint{SourceForge}{https://sourceforge.net/projects}
\DeclareFieldAlias{eprint:launchpad}{eprint:SourceForge}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{HEPForge}
% Add HEPForge as a eprint option
% \begin{macrocode}
\DeclareFieldFormat{eprint:hepforge}{%
HEPForge\addcolon\space\bib@online{https://#1/hepforge.org}{#1}%
}
\DeclareFieldAlias{eprint:HEPForge}{eprint:hepforge}
% \end{macrocode}
% \end{macro}
%
%
%<*package>
%
% End check for bibliography option.
% \begin{macrocode}
\fi
% \end{macrocode}
% \section{Hyperlinks, Footnotes and References} \label{sec:hyperlinks}
%
% Load the \software{hyperref} package \cite{hyperref} enable Unicode encoding and hide links.
%
% \begin{macrocode}
\RequirePackage{hyperref}
\hypersetup{
pdfencoding=auto, psdextra,
hidelinks, linktoc=all, breaklinks=true,
pdfcreator={}, pdfproducer={}
}
% \end{macrocode}
% Set the \PDF meta data according to the paper information and ensure that unnecessary information is suppressed.
%
% \begin{macrocode}
\pdfstringdefDisableCommands{\def\varepsilon{\textepsilon}}
\pdfstringdefDisableCommands{\def\to{\textrightarrow}}
\AtBeginDocument{
\pdfstringdefDisableCommands{\let\ensuremath\@gobble}
\pdfstringdefDisableCommands{\let\mathsurround\@gobble}
\pdfstringdefDisableCommands{\let\unskip\@gobble}
\pdfstringdefDisableCommands{\let\thanks\@gobble}
\pdfstringdefDisableCommands{\let\footnote\@gobble}
\pdfstringdefDisableCommands{\let\\\@gobble}
}
\ifhep@revtex
\AtBeginShipout{\hypersetup{pdftitle={\@title}}}
\else
\ifhep@beamer\else
\AtBeginDocument{\hypersetup{pdftitle={\@title}}}
\fi
\fi
\ifhep@title
\AtBeginDocument{\hypersetup{pdfauthor=\AB@authlist}}
\else
\ifhep@beamer\else
\ifhep@pos\else\AtBeginDocument{\hypersetup{pdfauthor={\@author}}}\fi
\fi
\fi
% \end{macrocode}
% \subsection{Footnotes}
%
% Place a hyperlink from the footnote back to its referencing label using the \software{footnotebackref} package \cite{footnotebackref}.
% \begin{macrocode}
\def\BackrefFootnoteTag{}
\RequirePackage{footnotebackref}
% \end{macrocode}
%
% \begin{macro}{\footnote}
% Ensure that no spaces appear before the footmark or at the beginning of the footnote.
% \begin{macrocode}
\let\@foot@note\footnote
\renewcommand{\footnote}[1]{\unskip\@foot@note{\ignorespaces#1}}
% \end{macrocode}
% \end{macro}
% \subsection{References}
%
% Begin of "references" conditional
% \begin{macrocode}
\ifhep@references
% \end{macrocode}
%
% \begin{macro}{\cref}
% Improve reference using the \software{cleveref} package \cite{cleveref}.
%
% \begin{macrocode}
\RequirePackage[noabbrev, nameinlink]{cleveref}
\newcommand{\creflastconjunction}{, and\nobreakspace}
\crefname{enumi}{point}{points}
\crefname{inlinelisti}{point}{points}
% \end{macrocode}
% \end{macro}
%
%\begin{macro}{\no@break@before}
% Define a macro able to prevent line breaks.
% \begin{macrocode}
\newcommand\no@break@before{%
\relax\ifvmode\else%
\ifhmode%
\ifdim\lastskip > 0pt%
\relax\unskip\nobreakspace%
\fi%
\fi%
\fi%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\ref}
% Adjust "\ref"\marg{key} in order to prevent preceding line breaks.
% \begin{macrocode}
\let\hep@ref\ref
\AtBeginDocument{\renewcommand\ref{\no@break@before\hep@ref}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqref}
% Adjust "\eqref"\marg{key} in order to prevent preceding line breaks.
% \begin{macrocode}
\renewcommand\eqref{\no@break@before\labelcref}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subref}
% Adjust "\subref"\marg{key} in order to prevent preceding line breaks.
% \begin{macrocode}
\let\hep@subref\subref
\renewcommand\subref{\no@break@before\hep@subref}
\renewcommand*\subcaption@ref[2]{\begingroup%
\caption@setoptions{sub}%
\subcaption@reffmt\p@subref{\hep@ref#1{sub@#2}}%
\endgroup}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\subcref}
% Provide the "\subcref" macro.
% \begin{macrocode}
\newcommand{\subcref}[1]{\cref{sub@#1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\eqcrefname}
% Define the "\eqcrefname" macro for named equation types.
% \begin{macrocode}
\NewDocumentCommand{\eqcrefname}{mmo}{
\crefname{#1}{#2}{\IfValueTF{#3}{#3}{#2s}}
\creflabelformat{#1}{(##2##1##3)}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\labelcrefrange}
% Define the missing "\labelcrefrange"\marg{key1}\marg{key2} macro.
% \begin{macrocode}
\DeclareRobustCommand{\labelcrefrange}[2]{%
\@crefrangenostar{labelcref}{#1}{#2}%
}
% \end{macrocode}
% \end{macro}
%
% Adjust the title page
% \begin{macrocode}
\ifhep@title
\labelcrefmultiformat{affiliation}{#2#1#3}{%
\textsuperscript,#2#1#3}{\textsuperscript,#2#1#3%
}{%
\textsuperscript,#2#1#3%
}
\labelcrefrangeformat{affiliation}{#3#1#4\textsuperscript{--}#5#2#6}
% \thanksmarkseries{alph}
\fi
% \end{macrocode}
%
% End of "references" conditional
% \begin{macrocode}
\fi
% \end{macrocode}
% \subsection{Citations}
%
% \begin{macro}{\cite}
% Adjust "\cite"\marg{key} in order to prevent preceding line breaks.
% \begin{macrocode}
\let\hep@cite\cite
\renewcommand\cite{\no@break@before\hep@cite}
% \end{macrocode}
% \end{macro}
%
% Begin of bibliography if.
% \begin{macrocode}
\ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else
% \end{macrocode}
% Define bibstrings for reference names.
% \begin{macrocode}
\NewBibliographyString{refname}
\NewBibliographyString{refsname}
\DefineBibliographyStrings{english}{%
refname = {reference},
refsname = {references}
}
% \end{macrocode}
% \begin{macro}{\ccite}
% \begin{macro}{\Ccite}
% Define \emph{clever} citation macros.
% \begin{macrocode}
\DeclareCiteCommand{\ccite}{%
\ifnum\thecitetotal=1
\bibstring{refname}%
\else%
\bibstring{refsname}%
\fi%
\addnbspace\bibopenbracket%
\usebibmacro{cite:init}\usebibmacro{prenote}%
}{\usebibmacro{citeindex}\usebibmacro{cite:comp}}{}{%
\usebibmacro{cite:dump}\usebibmacro{postnote}%
\bibclosebracket%
}
\newrobustcmd*{\Ccite}{\bibsentence\ccite}
% \end{macrocode}
% \end{macro}
% \end{macro}
% End of biblatex if.
% \begin{macrocode}
\fi
% \end{macrocode}
% \section{Acronyms}
%
% Define acronyms if not deactivated.
% \begin{macrocode}
\ifhep@glossaries
% \end{macrocode}
%
%
%<*package|acronyms>
%
% Acronyms are implemented with the \software{glossaries-extra} package \cite{glossaries-extra} which is an extension of the \software{glossaries} package \cite{glossaries} and must be loaded after the \software{hyperref} package in \cref{sec:hyperlinks}.
% Set the abbreviation style.
% \begin{macrocode}
\RequirePackage[nostyles]{glossaries-extra}
\setabbreviationstyle{long-hyphen-short-hyphen}
% \end{macrocode}
% The entry count feature is used.
% \begin{macrocode}
\glsenableentrycount
\glssetcategoryattribute{abbreviation}{entrycount}{1}
% \end{macrocode}
% Provide macros for older "glossaries-extra" installations.
% \begin{macrocode}
\AtEndOfPackage{
\@ifpackageloaded{hyperref}{
\providecommand{\glsxtrusefield}[2]{\@gls@entry@field{#1}{#2}}
\providecommand{\glsxtrsetfieldifexists}[3]{\glsdoifexists{#1}{#3}}
\providecommand{\gGlsXtrSetField}[3]{%
\glsxtrsetfieldifexists{#1}{#2}{%
\csgdef{glo@\glsdetoklabel{#1}@#2}{#3}%
}%
}
% \end{macrocode}
% Hyperlinks from the abbreviation to their definition in the text are set.
% \begin{macrocode}
\glssetcategoryattribute{abbreviation}{nohyperfirst}{true}
\renewcommand*{\glsdonohyperlink}[2]{{%
\glsxtrprotectlinks\edef\fieldvalue{%
\glsxtrusefield{\glslabel}{hastarget}%
}%
\ifdefstring\fieldvalue{true}{#2}{%
\gGlsXtrSetField{\glslabel}{hastarget}{true}%
\glsdohypertarget{#1}{#2}%
}%
}}
}{\providecommand{\pdfstringdefDisableCommands}[1]{}}
}
% \end{macrocode}
%
% \begin{macro}{\begin@sentence}
% Mark the beginning of a paragraph as if it would follow a full stop using the \software{everyhook} package \cite{everyhook}.
% \begin{macrocode}
\RequirePackage[excludeor]{everyhook}
\newcommand{\begin@sentence}{1001}
\PushPostHook{par}{{\spacefactor=\begin@sentence}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\frenchspacing}
% Adjust the "\frenchspacing" macro to be compatibel with this idea.
% \begin{macrocode}
\def\frenchspacing{%
\sfcode`\.\begin@sentence \sfcode`\?\begin@sentence
\sfcode`\!\begin@sentence \sfcode`\:\begin@sentence
\sfcode`\;\@m \sfcode`\,\@m
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\if@begin@of@sentence}
% Provide a macro checking for the beginning of a sentence by examining the length of the preceeding space.
% \begin{macrocode}
\newcommand{\if@begin@of@sentence}[2]{\leavevmode\protecting{%
\ifboolexpr{ test {\ifnumcomp{\spacefactor}{=}{3000}} or%
test {\ifnumcomp{\spacefactor}{=}{2000}} or%
test {\ifnumcomp{\spacefactor}{=}{\begin@sentence}}%
}{#1}{#2}%
}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\acronym}
% The "\acronym"\meta{*}\oarg{typeset abbreviation}\marg{abbreviation}\meta{*}\marg{definition}\oarg{plural\linebreak[4] definition} macro is defined.
% \begin{enumerate}[nosep, label=\#\arabic*]
% \item star for omitting the \enquote{s} in the short plural
% \item optional typeset abbreviation
% \item mandatory abbreviation
% \item star for restoring the \hologo{TeX} default for space after text macros
% \item mandatory long form
% \item optional plural long form
% \end{enumerate}
% \begin{macrocode}
%\RequirePackage{xspace}
\NewDocumentCommand{\acronym}{somsmo}{
\newabbreviation[
type=\acronymtype,
sort=#3,
\glsshortpluralkey=\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}},
longplural=\IfNoValueTF{#6}{#5s}{#6}
]{#3}{\IfNoValueTF{#2}{#3}{#2}}{#5}
% \end{macrocode}
% Provide the singular acronym macro.
% \begin{macrocode}
\expandafter\newcommand\csname#3\endcsname[1][]{%
\if@begin@of@sentence{%
\ifglsused{#3}{\cgls{#3}[##1]}{\cGls{#3}[##1]}%
}{\cgls{#3}[##1]}%
\ifnum\glsentrycurrcount{#3}>1\relax
\IfBooleanTF{#4}{}{\@\xspace}%
\else\@\xspace\fi
}
% \end{macrocode}
% Expand the singular acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{%
\IfNoValueTF{#2}{#3}{#2} }%
}
% \end{macrocode}
% Provide the singular acronym macro in math mode.
% \begin{macrocode}
\expandafter\mathdef\csname#3\endcsname{%
\text{\glsxtrshort{#3}}\@gls@increment@currcount{#3}%
}
% \end{macrocode}
% Provide the plural acronym macro.
% \begin{macrocode}
\expandafter\newcommand\csname#3s\endcsname[1][]{%
\if@begin@of@sentence{\cGlspl{#3}[##1]}{\cglspl{#3}[##1]}%
\IfBooleanTF{#4}{}{\@\xspace}%
}
% \end{macrocode}
% Expand the plural acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{%
\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }%
}
% \end{macrocode}
% Provide the plural acronym macro in math mode.
% \begin{macrocode}
\expandafter\mathdef\csname#3s\endcsname{%
\text{\glsxtrshortpl{#3}}\@gls@increment@currcount{#3}%
}
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\shortacronym}
% The "\shortacronym" never expands into the long form.
% \begin{macrocode}
\NewDocumentCommand{\shortacronym}{somsmo}{
% \end{macrocode}
% Provide the singular acronym macro.
% \begin{macrocode}
\expandafter\newcommand\csname#3\endcsname[1][]{%
\IfNoValueTF{#2}{#3}{#2}\IfBooleanTF{#4}{}{\@\xspace}##1%
}
% \end{macrocode}
% Expand the singular acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{%
\IfNoValueTF{#2}{#3}{#2} }%
}
% \end{macrocode}
% Provide the singular acronym macro in math mode.
% \begin{macrocode}
\expandafter\mathdef\csname#3\endcsname{%
\text{\IfNoValueTF{#2}{#3}{#2}}%
}
% \end{macrocode}
% Provide the plural acronym macro.
% \begin{macrocode}
\expandafter\newcommand\csname#3s\endcsname[1][]{%
\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}}%
\IfBooleanTF{#4}{}{\@\xspace}##1%
}
% \end{macrocode}
% Expand the plural acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{%
\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }%
}
% \end{macrocode}
% Provide the plural acronym macro in math mode.
% \begin{macrocode}
\expandafter\mathdef\csname#3s\endcsname{%
\text{\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}}}%
}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\longacronym}
% The "\longacronym" never shows the abbreviated form.
% \begin{macrocode}
\NewDocumentCommand{\longacronym}{somsmo}{
% \end{macrocode}
% Provide the singular acronym macro.
% \begin{macrocode}acronyms
\expandafter\newcommand\csname#3\endcsname[1][]{%
\if@begin@of@sentence{\MakeUppercase#5}{#5}%
\IfBooleanTF{#4}{}{\@\xspace}##1%
}
% \end{macrocode}
% Expand the singular acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{#5 }}
% \end{macrocode}
% Provide the plural acronym macro.
% \begin{macrocode}
\expandafter\newcommand\csname#3s\endcsname[1][]{%
\if@begin@of@sentence{%
\IfNoValueTF{#6}{\MakeUppercase#5s}{\MakeUppercase#6}%
}{%
\IfNoValueTF{#6}{#5s}{#6}}\IfBooleanTF{#4}{}{\@\xspace}##1%
}
% \end{macrocode}
% Expand the plural acronym macro in \PDF labels.
% \begin{macrocode}
\pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{%
\IfNoValueTF{#6}{#5s}{#6} }%
}
}
% \end{macrocode}
% \end{macro}
% Silence warning if no acronyms are defined.
% \begin{macrocode}
\renewcommand*{\@gls@write@entrycounts}{%
\immediate\write\@auxout{%
\string\providecommand*{\string\@gls@entry@count}[2]{}
}%
\count@=0\relax
\forallglsentries{\@glsentry}{%
\glshasattribute{\@glsentry}{entrycount}{%
\ifglsused{\@glsentry}{%
\immediate\write\@auxout{%
\string\@gls@entry@count{\@glsentry}{%
\glsentrycurrcount{\@glsentry}%
}
}%
}{}\advance\count@ by \@ne
}{}%
}%
}
% \end{macrocode}
% \begin{macro}{\resetacronym}
% \begin{macro}{\dummyacronym}
% Add two macros for acronym management.
% \begin{macrocode}
\newcommand{\resetacronym}[1]{\protect\glsreset{#1}}
\newcommand{\dummyacronym}[1]{\protect\glsunset{#1}}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{abstract}
% Adjust the "abstract" environment to reset all acronym counters.
% \begin{macrocode}
\@ifundefined{endabstract}{}{%
\let\end@hep@abstract\endabstract%
\renewcommand\endabstract{\glsresetall\end@hep@abstract}%
}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\tableofcontents}
% \begin{macro}{\listoffigures}
% \begin{macro}{\listoftables}
% Adjust the "\tableofcontents" macro to never show the long form of acronyms.
% \begin{macrocode}
\let\hep@table@of@contents\tableofcontents
\renewcommand\tableofcontents{%
\glsunsetall\hep@table@of@contents\glsresetall%
}
\let\hep@list@of@figures\listoffigures
\renewcommand\listoffigures{%
\glsunsetall\hep@list@of@figures\glsresetall%
}
\let\hep@list@of@tables\listoftables
\renewcommand\listoftables{%
\glsunsetall\hep@list@of@tables\glsresetall%
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\acronyms}
% Add a possibility to have different groups of acronyms.
% \begin{macrocode}
\NewDocumentCommand{\acronyms}{om}{%
\IfNoValueTF{#1}{
\newglossary{#2}{#2.in}{#2.out}{#2}%
\renewcommand{\acronymtype}{#2}%
}{
\newglossary{#1}{#1.in}{#1.out}{#2}%
\renewcommand{\acronymtype}{#1}%
}
}
% \end{macrocode}
% \end{macro}
%
%
%<*package>
%
% End of glossaries if.
% \begin{macrocode}
\fi
% \end{macrocode}
%
%
%
%
% \section{Biblatex datamodel file} \label{sec:data model}
%
%<*datamodel>
%
% \begin{macro}{collaboration}
% \begin{macro}{pmid}
% \begin{macro}{pmcid}
% \begin{macro}{pmc}
% \begin{macro}{reportnumber}
% \begin{macro}{protocollessurl}
% Define the "dbx" file containing the "hep-paper" datamodel.
% \begin{macrocode}
\DeclareDatamodelFields[type=field, datatype=literal]{
collaboration, pmid, pmcid, pmc,
}
\DeclareDatamodelFields[type=field, format=xsv, datatype=literal]{
reportnumber,
}
\DeclareDatamodelFields[type=field, datatype=uri]{protocollessurl}
\DeclareDatamodelEntryfields{
collaboration, pmid, pmcid, pmc, reportnumber, protocollessurl,
}
% \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
% \end{macro}
%
%
%
% \Finale
\endinput
% \PrintIndex
% makeindex -s gglo.ist -o hep-paper-implementation.gls hep-paper-implementation.glo
% makeindex -s gglo.ist -o hep-paper-implementation.ind hep-paper-implementation.idx
% \begin{macro}{\refstepcounter@...}
% Adjust the "cleveref" "\refstepcounter@noarg" and "\refstepcounter@optarg" to use the "\@currentlabel" in order to fix problems with "\subref".
% \begin{macrocode}
% \def\refstepcounter@noarg#1{%
% \cref@old@refstepcounter{#1}%
% \cref@constructprefix{#1}{\cref@result}%
% \@ifundefined{cref@#1@alias}%
% {\def\@tempa{#1}}%
% {\def\@tempa{\csname cref@#1@alias\endcsname}}%
% \protected@edef\cref@currentlabel{%
% [\@tempa][\arabic{#1}][\cref@result]%
% \noexpand\@currentlabel%
% }% changed
% }
%
% \def\refstepcounter@optarg[#1]#2{%
% \cref@old@refstepcounter{#2}%
% \cref@constructprefix{#2}{\cref@result}%
% \@ifundefined{cref@#1@alias}%
% {\def\@tempa{#1}}%
% {\def\@tempa{\csname cref@#1@alias\endcsname}}%
% \protected@edef\cref@currentlabel{%
% [\@tempa][\arabic{#2}][\cref@result]%
% \noexpand\@currentlabel% changed
% }%
% }
% % \end{macrocode}
% % \end{macro}
%
%
% \RequirePackage{contour}
% \renewcommand{\ULdepth}{1.8pt}
% \contourlength{0.8pt}
% \newcommand{\myuline}[1]{%
% \uline{\phantom{#1}}\llap{\contour{white}{#1}}%
% }
% \begin{macro}{\mathpzc}
% Define the "\mathpzc" math script font based on the Zapf Chancery PostScript font.
% \begin{macrocode}
% \DeclareFontFamily{OT1}{pzc}{}
% \DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.15] pzcmi7t}{}
% \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
% \end{macrocode}
% \end{macro}