%% %% This is file `hep-paper.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% hep-paper.dtx (with options: `package') %% This is a generated file. %% Copyright (C) 2019-2020 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. \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{hep-paper}[2020/03/01 v1.2 Publications in High Energy Physics] \RequirePackage{kvoptions} \SetupKeyvalOptions{ family=hep, prefix=hep@ } \DeclareStringOption[a4]{paper} \DeclareStringOption[11pt]{font} \DeclareBoolOption[false]{defaults} \DeclareStringOption[british]{lang} \DeclareBoolOption[true]{parindent} \DeclareComplementaryOption{parskip}{parindent} \DeclareBoolOption[true]{serif} \DeclareComplementaryOption{sansserif}{serif} \DeclareBoolOption[false]{eqnarray} \DeclareStringOption[numeric-comp]{bibliography} \DeclareBoolOption[true]{glossaries} \DeclareBoolOption[false]{manualplacement} \DeclareBoolOption[true]{title} \DeclareBoolOption[false]{revtex} \ProcessKeyvalOptions* \ifhep@revtex \setkeys{hep}{defaults, title=false, lang=american, bibliography=false} \fi \RequirePackage{ifluatex} \RequirePackage{ifxetex} \newif\ifxetexorluatex \ifxetex\xetexorluatextrue\else \ifluatex\xetexorluatextrue \else\xetexorluatexfalse \fi \fi \RequirePackage{alphabeta} \ifxetexorluatex \def\@encoding{TU} \else \def\@encoding{T1} \fi \RequirePackage[\@encoding]{fontenc} \RequirePackage{lmodern} \RequirePackage{textcomp} \RequirePackage{microtype} \ifxetexorluatex \DeclareFontShape{\@encoding}{lmss}{bx}{sc}{<->cmssbxcsc10}{} \DeclareFontShape{\@encoding}{lmss}{m}{sc}{% <-9>cmsscsc8<9-10>cmsscsc9<10->cmsscsc10% }{} \else \sffamily \DeclareFontShape{\@encoding}{lmss}{bx}{sc}{<->ssub*xcmss/bx/sc}{} \DeclareFontShape{\@encoding}{lmss}{m}{sc}{<->ssub*xcmss/m/sc}{} \fi \ifxetexorluatex\else \RequirePackage[utf8]{inputenc} \fi \RequirePackage[\hep@lang]{babel} \RequirePackage{csquotes} \ifhep@serif\else \renewcommand\familydefault{\sfdefault} \fi \RequirePackage{soul} \let\underline\ul \ifhep@defaults\else \def\remove@pt#1pt{#1} \edef\@ptsize{\expandafter\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\@ptsize.clo} \fi \RequirePackage{pdftexcmds} \newcommand{\hep@lang@foreign}{british} \ifnum\pdf@strcmp{\hep@lang}{american}=0% \renewcommand{\hep@lang@foreign}{USenglish}% \fi \ifnum\pdf@strcmp{\hep@lang}{USenglish}=0% \renewcommand{\hep@lang@foreign}{USenglish}% \fi \RequirePackage[all, \hep@lang@foreign]{foreign} \DeclareRobustCommand\vs{\xperiodafter{{\foreignabbrfont{vs}}}} \newcommand{\no}[1]{\textnumero~#1} \RequirePackage{relsize} \newcommand{\software}[2][\hspace{-\fontdimen2\font}]{% {\smaller\textsc{#2}~#1}% } \newcommand{\online}[2]{\href{#1}{\url{#2}}} \RequirePackage[inline]{enumitem} \newlist{inlinelist}{enumerate*}{1} \setlist*[inlinelist,1]{% label=\roman*), itemjoin={,\ }, itemjoin*={, and\ }, after=.% } \newlist{enum@descript}{enumerate}{2} \setlist[enum@descript]{label=\arabic*.} \newenvironment{enumdescript}[1][]{ \begin{enum@descript}[#1] \let\old@item\item \renewcommand{\item}[2][]{ \ifx&##1&\old@item\else\old@item[##1]\fi \textbf{##2}\ifx##2\empty\else~\fi\@ifnextchar\par\@gobble\relax } }{\end{enum@descript}} \let\@foot@note\footnote \renewcommand{\footnote}[1]{\unskip\@foot@note{\ignorespaces#1}} \ifhep@defaults\else \RequirePackage[\hep@paper paper]{geometry} \geometry{hscale=.75, vscale=.8, vmarginratio=3:4, includeheadfoot} \fi \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 \RequirePackage{mathtools} \RequirePackage{amssymb} \allowdisplaybreaks[1] \DeclareMathOperator{\diag}{diag} \RequirePackage{xparse} \DeclareDocumentCommand{\mathdef}{mO{0}m}{% \expandafter\let\csname old\string#1\endcsname=#1 \expandafter\newcommand\csname new\string#1\endcsname[#2]{#3} \DeclareRobustCommand#1{% \ifmmode \expandafter\let\expandafter\next\csname new\string#1\endcsname \else \expandafter\let\expandafter\next\csname old\string#1\endcsname \fi \next }% } \AtBeginDocument{\mathdef{\i}{\operatorname{i}}} \ifhep@eqnarray\else% \let\eqnarray\@undefined \let\endeqnarray\@undefined \fi \RequirePackage{bm} \let\mathbf\bm \g@addto@macro\bfseries{\boldmath} \ifhep@serif \RequirePackage{fixmath} \DeclareMathAlphabet{\mathsf}{OML}{cmbr}{m}{it} \SetMathAlphabet{\mathsf}{bold}{OML}{cmbr}{bx}{it} \else \RequirePackage[slantedGreek]{sfmath} \DeclareMathAlphabet{\mathsf}{OML}{cmm}{m}{it} \SetMathAlphabet{\mathsf}{bold}{OML}{cmm}{bx}{it} \fi \RequirePackage{mathrsfs} \RequirePackage{physics} \RequirePackage{slashed} \RequirePackage{units} \newcommand{\inv}[2][1]{#2\ensuremath{^{-#1}}} \newcommand{\oset}[3][-1pt]{% \raisebox{1pt}{\ensuremath{\mathop{#3}\limits^{% \vbox to#1{\kern-2\ex@\hbox{$\scriptscriptstyle#2$}\vss}% }}}% } \newcommand{\overleftright}[1]{\oset{\leftrightarrow}{#1}} \renewcommand{\textfraction}{0.01} \setcounter{topnumber}{1} \renewcommand{\topfraction}{.9} \setcounter{bottomnumber}{0} \renewcommand{\floatpagefraction}{.8} \let\@figure@\figure% \let\@end@figure@\endfigure% \let\@table@\table% \let\@end@table@\endtable% \ifhep@manualplacement% \renewenvironment{figure}[1][tbp]{% \@figure@[#1]\centering% }{\@end@figure@}% \renewenvironment{table}[1][tbp]{% \@table@[#1]\centering% }{\@end@table@}% \else% \renewenvironment{figure}[1][]{% \@figure@\centering% }{\@end@figure@}% \renewenvironment{table}[1][]{% \@table@\centering% }{\@end@table@} \fi% \ifhep@revtex \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 \RequirePackage[subrefformat = parens]{subcaption} \captionsetup{font=small} \captionsetup[sub]{font=small} \newenvironment{panels}[2][b]{% \newcommand{\begin@subcaption@minipage}[2][b]{% \caption@withoptargs\subcaption@minipage[##1]{##2}% \centering\vskip 0pt% } \ifdim#2pt>1pt% \newcommand{\panel}[1][b]{% \endminipage\hfill\begin@subcaption@minipage[#1]{\linewidth/#2}% }% \begin@subcaption@minipage[#1]{\linewidth/#2}% \else% \newcommand{\panel}[2][b]{% \endminipage\hfill\begin@subcaption@minipage[#1]{##2\linewidth}% }% \begin@subcaption@minipage[#1]{#2\linewidth}% \fi% }{\endminipage} \ifhep@revtex \renewcommand{\figurename}{Figure} \renewcommand{\tablename}{Table} \RequirePackage{ragged2e} \DeclareCaptionFormat{revtex}{#1#2\justifying{#3}} \captionsetup{font = small, format = revtex} \captionsetup[sub]{font = footnotesize, format = plain} \fi \RequirePackage{booktabs} \RequirePackage{multirow} \RequirePackage{graphicx} \providecommand{\tikzsetnextfilename}[1]{} \newcommand{\graphic}[2][1]{\tikzsetnextfilename{#2}{% \centering\includegraphics[width=#1\linewidth]{#2}% }} \newcommand{\graphics}[1]{\graphicspath{{./#1/}}} \ifhep@title \date{} \author{} \AtEndOfClass{\newcommand{\email}[1]{% \unskip\thanks{\online{mailto:#1}{#1}} }} \RequirePackage{authblk} \renewcommand\Affilfont{\footnotesize} \newcommand\active@comma{,\penalty-5\relax} \newcommand\cat@comma@active{\catcode`\,\active} {\cat@comma@active\gdef,{\active@comma}} \newcommand\@affil[1]{% \endgroup\@flushglue=0pt plus .5\linewidth\affil{#1}% } \def\@affil@opt[#1]#2{% \endgroup\@flushglue=0pt plus .5\linewidth\affil[#1]{#2}% } \DeclareRobustCommand\@affiliation{\@ifnextchar[{\@affil@opt}{\@affil}} \newcommand{\affiliation}{\begingroup\cat@comma@active\@affiliation} \let\@preprint\relax \newcommand\preprint[1]{\long\gdef\@preprint{#1}} \RequirePackage{varwidth} \newcommand{\@preprint@box}{% \begin{varwidth}{\textwidth}% \textsc{\small\@preprint}% \end{varwidth}% } \RequirePackage{atbegshi} \RequirePackage{picture} \AtBeginShipoutFirst{% \put( \textwidth+\oddsidemargin-\widthof{\@preprint@box}, -2pt-\topmargin-\heightof{\@preprint@box} ){\normalfont\@preprint@box} } \let\old@abstract\abstract \renewcommand\abstract{\old@abstract\noindent\ignorespaces} \fi \ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else \RequirePackage[style=\hep@bibliography]{biblatex} \ExecuteBibliographyOptions{ sorting=none, giveninits=true } \newcommand{\@reg@exp}{\regexp{\A(\p{L}+)?\d+(\p{L}+)?\Z}} \newcommand{\@reg@exp@}{\regexp{\A(\p{L}+)?(\d+)(\p{L}+)?\Z}} \DeclareSourcemap{% \maps[datatype=bibtex,overwrite=true]{% \map{% \step[fieldsource=Collaboration,final=true]% \step[fieldset=usere,origfieldval,final=true] }% \map{% \step[fieldsource=reportNumber,final=true]% \step[fieldset=userf,origfieldval,final=true] }% \map[overwrite]{ \step[fieldsource=volume, match=\@reg@exp, final] \step[fieldsource=volume, match=\@reg@exp@, replace={$2}] \step[fieldsource=journal, fieldtarget=journaltitle] \step[fieldset=journaltitle, fieldvalue={\space$1$2}, append=true] } }% } \renewbibmacro*{author}{% \iffieldundef{usere}{\printnames{author}}{\textbf{\printfield{usere}}}% } \renewbibmacro*{in:}{% \iffieldundef{journal}{}{\printtext{\bibstring{in}\intitlepunct}}% } \providecommand{\letbibmacro}[2]{\csletcs{abx@macro@#1}{abx@macro@#2}} \letbibmacro{doi+eprint+url-old}{doi+eprint+url} \renewbibmacro*{doi+eprint+url}{% \usebibmacro{doi+eprint+url-old} \iffieldundef{userf}{}{\textls[0]{% \newunitpunct\textnumero\intitlepunct% \textsc{\small\printfield{userf}}% }}% } \DeclareFieldFormat{eprint:ctan}{% CTAN\addcolon\space\ifhyperref{% \href{https://ctan.org/pkg/#1}{\nolinkurl{#1}}% }{\nolinkurl{#1}}% } \DeclareFieldAlias{eprint:CTAN}{eprint:ctan} \DeclareFieldFormat{eprint:github}{% GitHub\addcolon\space\ifhyperref{\href{% https://github.com/\thefield{eprintclass}/#1% }{\nolinkurl{\thefield{eprintclass}/#1}}% }{\nolinkurl{\thefield{eprintclass}/#1}}% } \DeclareFieldAlias{eprint:GitHub}{eprint:github} \DeclareFieldFormat{eprint:gitlab}{% GitLab\addcolon\space\ifhyperref{\href{% https://gitlab.com/\thefield{eprintclass}/#1% }{\nolinkurl{\thefield{eprintclass}/#1}}% }{\nolinkurl{\thefield{eprintclass}/#1}}% } \DeclareFieldAlias{eprint:GitLab}{eprint:gitlab} \DeclareFieldFormat{eprint:sourceforge}{% SourceForge\addcolon\space\ifhyperref{% \href{https://sourceforge.net/projects/#1}{\nolinkurl{#1}}% }{\nolinkurl{#1}}% } \DeclareFieldAlias{eprint:SourceForge}{eprint:sourceforge} \DeclareFieldFormat{eprint:hepforge}{% HEPForge\addcolon\space\ifhyperref{% \href{https://#1/hepforge.org/}{\nolinkurl{#1}}% }{\nolinkurl{#1}}% } \DeclareFieldAlias{eprint:HEPForge}{eprint:hepforge} \NewBibliographyString{erratum} \DefineBibliographyStrings{english}{erratum={Erratum:}} \let\old@printbibliography\printbibliography \renewcommand{\printbibliography}{\sloppy\old@printbibliography} \fi \RequirePackage{hyperref} \hypersetup{ pdfencoding=auto, psdextra, hidelinks, linktoc=all, breaklinks=true, pdfcreator={}, pdfproducer={} } \pdfstringdefDisableCommands{\def\varepsilon{\textepsilon}} \AtBeginDocument{ \pdfstringdefDisableCommands{\let\ensuremath\@gobble} \pdfstringdefDisableCommands{\let\mathsurround\@gobble} \pdfstringdefDisableCommands{\let\unskip\@gobble} \pdfstringdefDisableCommands{\let\thanks\@gobble} \pdfstringdefDisableCommands{\let\footnote\@gobble} \pdfstringdefDisableCommands{\let\\\@gobble} } \AtBeginShipout{\hypersetup{pdftitle={\@title}}} \ifhep@title \AtBeginDocument{\hypersetup{pdfauthor=\AB@authlist}} \else \AtBeginDocument{\hypersetup{pdfauthor={\@author}}} \fi \RequirePackage[noabbrev, capitalize, nameinlink]{cleveref} \crefname{enumi}{point}{points} \Crefname{enumi}{Point}{Points} \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 }% } \newcommand\no@break@before{% \relax\ifvmode\else% \ifhmode% \ifdim\lastskip > 0pt% \relax\unskip\nobreakspace% \fi% \fi% \fi% } \let\old@ref\ref \AtBeginDocument{\renewcommand\ref{\no@break@before\labelcref}} \renewcommand\eqref{\no@break@before\labelcref} \let\old@subref\subref \renewcommand\subref{\no@break@before\old@subref} \renewcommand*\subcaption@ref[2]{\begingroup% \caption@setoptions{sub}% \subcaption@reffmt\p@subref{\old@ref#1{sub@#2}}% \endgroup} \newcommand{\subcref}[1]{\cref{sub@#1}} \DeclareDocumentCommand{\eqcrefname}{mmo}{ \crefname{#1}{#2}{\IfValueTF{#3}{#3}{#2s}} \creflabelformat{#1}{(##2##1##3)} } \DeclareRobustCommand{\labelcrefrange}[2]{% \@crefrangenostar{labelcref}{#1}{#2}% } \let\old@cite\cite \renewcommand\cite{\no@break@before\old@cite} \ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else \NewBibliographyString{refname} \NewBibliographyString{refsname} \DefineBibliographyStrings{english}{% refname = {Reference}, refsname = {References} } \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} \fi \ifhep@glossaries \RequirePackage[nostyles]{glossaries-extra} \glsenableentrycount \glssetcategoryattribute{abbreviation}{entrycount}{1} \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}% }% } \glssetcategoryattribute{abbreviation}{nohyperfirst}{true} \renewcommand*{\glsdonohyperlink}[2]{{% \glsxtrprotectlinks\edef\fieldvalue{% \glsxtrusefield{\glslabel}{hastarget}% }% \ifdefstring\fieldvalue{true}{#2}{% \gGlsXtrSetField{\glslabel}{hastarget}{true}% \glsdohypertarget{#1}{#2}% }% }} \usepackage[excludeor]{everyhook} \PushPostHook{par}{{\spacefactor=3000}} \newcommand{\if@begin@of@sentence}[2]{\leavevmode\protecting{% \ifboolexpr{ test {\ifnumcomp{\spacefactor}{=}{3000}} or% test {\ifnumcomp{\spacefactor}{=}{2000}}% }{#1}{#2}% }} \DeclareDocumentCommand{\acronym}{sommo}{ \newabbreviation[ longplural=\IfNoValueTF{#5}{#4s}{#5}, \glsshortpluralkey=\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} ]{#3}{\IfNoValueTF{#2}{#3}{#2}}{#4} \expandafter\newcommand\csname#3\endcsname{% \if@begin@of@sentence{\cGls{#3}}{\cgls{#3}}\@\xspace% } \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{% \IfNoValueTF{#2}{#3}{#2} }% } \expandafter\mathdef\csname#3\endcsname{% \text{\glsxtrshort{#3}}\glsunset{#3}% } \expandafter\newcommand\csname#3s\endcsname{% \if@begin@of@sentence{\cGlspl{#3}}{\cglspl{#3}}\@\xspace% } \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% \IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }% } \expandafter\mathdef\csname#3s\endcsname{% \text{\glsxtrshortpl{#3}}\glsunset{#3}% } } \DeclareDocumentCommand{\shortacronym}{somm}{ \newabbreviation[ \glsshortpluralkey=\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} ]{#3}{\IfNoValueTF{#2}{#3}{#2}}{#4} \expandafter\newcommand\csname#3\endcsname{\cgls*{#3}\@\xspace} \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{% \IfNoValueTF{#2}{#3}{#2} }% } \expandafter\mathdef\csname#3\endcsname{\text{\glsxtrshort*{#3}}} \expandafter\newcommand\csname#3s\endcsname{\cglspl*{#3}\@\xspace} \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% \IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }% } \expandafter\mathdef\csname#3s\endcsname{\text{\glsxtrshortpl*{#3}}}% \glsunset{#3} } \DeclareDocumentCommand{\longacronym}{sommo}{ \expandafter\newcommand\csname#3\endcsname{% \if@begin@of@sentence{\MakeUppercase#4}{#4}\@\xspace% } \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{#4 }} \expandafter\newcommand\csname#3s\endcsname{% \if@begin@of@sentence{% \IfNoValueTF{#5}{\MakeUppercase#4s}{\MakeUppercase#5}% }{% \IfNoValueTF{#5}{#4s}{#5}}\@\xspace% } \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% \IfNoValueTF{#5}{#4s}{#5} }% } } \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 }{}% }% } \newcommand{\resetacronym}[1]{\protect\glsreset{#1}} \newcommand{\dummyacronym}[1]{\protect\glsunset{#1}} \fi \endinput %% %% End of file `hep-paper.sty'.