diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty | 378 |
1 files changed, 225 insertions, 153 deletions
diff --git a/Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty b/Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty index e126a36b8a7..de375a04761 100644 --- a/Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty +++ b/Master/texmf-dist/tex/latex/hep-paper/hep-paper.sty @@ -15,8 +15,9 @@ %% 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] +\ProvidesPackage{hep-paper}[2020/05/01 v1.3 Publications in High Energy Physics] +\RequirePackage{pdftexcmds} \RequirePackage{kvoptions} \SetupKeyvalOptions{ family=hep, @@ -36,22 +37,49 @@ \DeclareBoolOption[false]{manualplacement} \DeclareBoolOption[true]{title} \DeclareBoolOption[false]{revtex} - +\DeclareBoolOption[false]{jhep} +\DeclareBoolOption[false]{jcap} +\DeclareBoolOption[false]{pos} \ProcessKeyvalOptions* +\ifhep@pos + \setkeys{hep}{title=false, defaults} +\fi \ifhep@revtex \setkeys{hep}{defaults, title=false, lang=american, bibliography=false} \fi +\newif\ifhep@sissa +\ifhep@jhep\hep@sissatrue +\else + \ifhep@jcap\hep@sissatrue + \else\hep@sissafalse + \fi +\fi +\ifhep@sissa + \setkeys{hep}{title=false, bibliography=false} + \PassOptionsToPackage{ + colorlinks=true, linktocpage=true, pdfproducer=medialab, pdfa=true, + urlcolor=blue, anchorcolor=blue, citecolor=blue, filecolor=blue, + linkcolor=blue, menucolor=blue, pagecolor=blue + }{hyperref} + \hoffset 0pt + \voffset 0pt +\fi \RequirePackage{ifluatex} \RequirePackage{ifxetex} \newif\ifxetexorluatex -\ifxetex\xetexorluatextrue\else +\ifxetex\xetexorluatextrue +\else \ifluatex\xetexorluatextrue - \else\xetexorluatexfalse + \else\xetexorluatexfalse \fi \fi \RequirePackage{alphabeta} +\ifhep@serif\else + \RequirePackage{sansmathfonts} + \renewcommand\familydefault{\sfdefault} +\fi \ifxetexorluatex \def\@encoding{TU} \else @@ -61,7 +89,6 @@ \RequirePackage{lmodern} \RequirePackage{textcomp} \RequirePackage{microtype} - \ifxetexorluatex \DeclareFontShape{\@encoding}{lmss}{bx}{sc}{<->cmssbxcsc10}{} \DeclareFontShape{\@encoding}{lmss}{m}{sc}{% @@ -76,17 +103,10 @@ \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} @@ -102,26 +122,25 @@ \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}% +\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}}}} +\xspaceaddexceptions{\csq@qclose@i} \newcommand{\no}[1]{\textnumero~#1} - \RequirePackage{relsize} \newcommand{\software}[2][\hspace{-\fontdimen2\font}]{% {\smaller\textsc{#2}~#1}% } - -\newcommand{\online}[2]{\href{#1}{\url{#2}}} - +\newcommand{\online}[2]{\href{#1}{\nolinkurl{#2}}} \RequirePackage[inline]{enumitem} \newlist{inlinelist}{enumerate*}{1} @@ -170,13 +189,13 @@ \RequirePackage{xparse} \DeclareDocumentCommand{\mathdef}{mO{0}m}{% - \expandafter\let\csname old\string#1\endcsname=#1 - \expandafter\newcommand\csname new\string#1\endcsname[#2]{#3} + \expandafter\let\csname text\string#1\endcsname=#1 + \expandafter\newcommand\csname math\string#1\endcsname[#2]{#3} \DeclareRobustCommand#1{% \ifmmode - \expandafter\let\expandafter\next\csname new\string#1\endcsname + \expandafter\let\expandafter\next\csname math\string#1\endcsname \else - \expandafter\let\expandafter\next\csname old\string#1\endcsname + \expandafter\let\expandafter\next\csname text\string#1\endcsname \fi \next }% @@ -184,11 +203,16 @@ \AtBeginDocument{\mathdef{\i}{\operatorname{i}}} -\ifhep@eqnarray\else% +\def\overline#1{{\setul{-2ex}{}\ul{#1}}} +\DeclareRobustCommand{\over@line}[1]{\@@overline{#1}} +\mathdef{\overline}{\over@line} + +\ifhep@eqnarray\else \let\eqnarray\@undefined \let\endeqnarray\@undefined \fi +\newcommand{\bmmax}{2} \RequirePackage{bm} \let\mathbf\bm \g@addto@macro\bfseries{\boldmath} @@ -198,10 +222,17 @@ \SetMathAlphabet{\mathsf}{bold}{OML}{cmbr}{bx}{it} \else \RequirePackage[slantedGreek]{sfmath} + \RequirePackage{sansmathfonts} \DeclareMathAlphabet{\mathsf}{OML}{cmm}{m}{it} \SetMathAlphabet{\mathsf}{bold}{OML}{cmm}{bx}{it} \fi \RequirePackage{mathrsfs} +\RequirePackage{bbm} +\ifhep@serif + \let\mathbb\mathbbm +\else + \let\mathbb\mathbbmss +\fi \RequirePackage{physics} \RequirePackage{slashed} @@ -209,6 +240,8 @@ \newcommand{\inv}[2][1]{#2\ensuremath{^{-#1}}} +\AtBeginDocument{\mathdef{\d}{\dd}} + \newcommand{\oset}[3][-1pt]{% \raisebox{1pt}{\ensuremath{\mathop{#3}\limits^{% \vbox to#1{\kern-2\ex@\hbox{$\scriptscriptstyle#2$}\vss}% @@ -257,9 +290,12 @@ \vskip\belowcaptionskip% } \fi -\RequirePackage[subrefformat = parens]{subcaption} +\RequirePackage[subrefformat=parens]{subcaption} \captionsetup{font=small} \captionsetup[sub]{font=small} +\providecommand*\subcaption@minipage[2]{% + \minipage#1{#2}\setcaptionsubtype\relax% +} \newenvironment{panels}[2][b]{% \newcommand{\begin@subcaption@minipage}[2][b]{% \caption@withoptargs\subcaption@minipage[##1]{##2}% @@ -279,12 +315,12 @@ }{\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} + \captionsetup{font=small, format=revtex} + \captionsetup[sub]{font=footnotesize, format=plain} + \renewcommand{\figurename}{Figure} + \renewcommand{\tablename}{Table} \fi \RequirePackage{booktabs} @@ -293,7 +329,7 @@ \RequirePackage{graphicx} \providecommand{\tikzsetnextfilename}[1]{} \newcommand{\graphic}[2][1]{\tikzsetnextfilename{#2}{% - \centering\includegraphics[width=#1\linewidth]{#2}% + \centering\includegraphics[width=#1\linewidth]{#2}\par% }} \newcommand{\graphics}[1]{\graphicspath{{./#1/}}} @@ -326,107 +362,137 @@ \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@maketitle\maketitle +\renewcommand{\maketitle}{% + \old@maketitle% + \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} +\@ifundefined{abstract}{}{% + \let\old@abstract\abstract% + \renewcommand\abstract{\old@abstract\noindent\ignorespaces}% +} \fi \ifnum\pdf@strcmp{\hep@bibliography}{false}=0\else -\RequirePackage[style=\hep@bibliography]{biblatex} +\RequirePackage[style=\hep@bibliography, datamodel=hep-paper]{biblatex} +\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} + } +} \ExecuteBibliographyOptions{ - sorting=none, + sorting=hep-paper, giveninits=true } -\newcommand{\@reg@exp}{\regexp{\A(\p{L}+)?\d+(\p{L}+)?\Z}} -\newcommand{\@reg@exp@}{\regexp{\A(\p{L}+)?(\d+)(\p{L}+)?\Z}} +\NewBibliographyString{erratum} +\DefineBibliographyStrings{english}{erratum={Erratum}} +\let\old@printbibliography\printbibliography +\renewcommand{\printbibliography}{\sloppy\old@printbibliography} + +\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)?:\/\/}} \DeclareSourcemap{% - \maps[datatype=bibtex,overwrite=true]{% + \maps[datatype=bibtex, overwrite=true]{% \map{% - \step[fieldsource=Collaboration,final=true]% - \step[fieldset=usere,origfieldval,final=true] + \step[fieldsource=Collaboration, final=true]% + \step[fieldset=collaboration, origfieldval, final=true] }% \map{% - \step[fieldsource=reportNumber,final=true]% - \step[fieldset=userf,origfieldval,final=true] + \step[fieldsource=reportNumber, final=true]% + \step[fieldset=reportnumber, origfieldval, final=true] }% \map[overwrite]{ - \step[fieldsource=volume, match=\@reg@exp, final] - \step[fieldsource=volume, match=\@reg@exp@, replace={$2}] + \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] } + \map{ + \step[fieldsource=url, final=true] + \step[fieldset=protocollessurl, origfieldval, final=true] + \step[fieldsource=protocollessurl, match=\reg@exp@url, replace={}] + } }% } - -\renewbibmacro*{author}{% - \iffieldundef{usere}{\printnames{author}}{\textbf{\printfield{usere}}}% -} - \renewbibmacro*{in:}{% - \iffieldundef{journal}{}{\printtext{\bibstring{in}\intitlepunct}}% + \iffieldundef{journaltitle}{}{\printtext{\bibstring{in}\intitlepunct}}% +} +\DeclareFieldFormat{url}{% + \mkbibacro{URL}\addcolon\space\online{#1}{\thefield{protocollessurl}}% +} +\renewbibmacro*{author}{% + \iffieldundef{collaboration}{% + \printnames{author}}{\textbf{\printfield{collaboration}}% + }% } - \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]{% + \iffieldundef{reportnumber}{}{\textls[0]{% \newunitpunct\textnumero\intitlepunct% - \textsc{\small\printfield{userf}}% + \textsc{\small\printfield{reportnumber}}% }}% } -\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}}% +\newcommand{\bib@online}[2]{% + \ifhyperref{\online{#1}{#2}}{\nolinkurl{#2}}% } -\DeclareFieldAlias{eprint:GitLab}{eprint:gitlab} - -\DeclareFieldFormat{eprint:sourceforge}{% - SourceForge\addcolon\space\ifhyperref{% - \href{https://sourceforge.net/projects/#1}{\nolinkurl{#1}}% - }{\nolinkurl{#1}}% +\NewDocumentCommand{\new@eprint}{smm}{ + \DeclareFieldFormat{eprint:#2}{% + \newcommand{\@path}{\IfBooleanT{#1}{\thefield{eprintclass}/}##1}% + #2\addcolon\space\bib@online{#3/\@path}{\@path}% + }% } -\DeclareFieldAlias{eprint:SourceForge}{eprint:sourceforge} - +\new@eprint{CTAN}{https://ctan.org/pkg} +\DeclareFieldAlias{eprint:ctan}{eprint:CTAN} +\new@eprint*{GitHub}{https://github.com} +\DeclareFieldAlias{eprint:github}{eprint:GitHub} +\new@eprint*{GitLab}{https://gitlab.com} +\DeclareFieldAlias{eprint:gitlab}{eprint:GitLab} +\new@eprint*{Bitbucket}{https://bitbucket.org} +\DeclareFieldAlias{eprint:bitbucket}{eprint:Bitbucket} +\new@eprint{Launchpad}{https://launchpad.net} +\DeclareFieldAlias{eprint:launchpad}{eprint:Launchpad} +\new@eprint{SourceForge}{https://sourceforge.net/projects} +\DeclareFieldAlias{eprint:launchpad}{eprint:SourceForge} \DeclareFieldFormat{eprint:hepforge}{% - HEPForge\addcolon\space\ifhyperref{% - \href{https://#1/hepforge.org/}{\nolinkurl{#1}}% - }{\nolinkurl{#1}}% + HEPForge\addcolon\space\bib@online{https://#1/hepforge.org}{#1}% } \DeclareFieldAlias{eprint:HEPForge}{eprint:hepforge} -\NewBibliographyString{erratum} -\DefineBibliographyStrings{english}{erratum={Erratum:}} - -\let\old@printbibliography\printbibliography -\renewcommand{\printbibliography}{\sloppy\old@printbibliography} \fi \RequirePackage{hyperref} @@ -448,41 +514,22 @@ \pdfstringdefDisableCommands{\let\footnote\@gobble} \pdfstringdefDisableCommands{\let\\\@gobble} } -\AtBeginShipout{\hypersetup{pdftitle={\@title}}} +\ifhep@revtex + \AtBeginShipout{\hypersetup{pdftitle={\@title}}} +\else + \AtBeginDocument{\hypersetup{pdftitle={\@title}}} +\fi \ifhep@title \AtBeginDocument{\hypersetup{pdfauthor=\AB@authlist}} \else \AtBeginDocument{\hypersetup{pdfauthor={\@author}}} \fi -\RequirePackage[noabbrev, capitalize, nameinlink]{cleveref} +\RequirePackage[noabbrev, nameinlink]{cleveref} +\newcommand{\creflastconjunction}{, and\nobreakspace} \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% @@ -507,7 +554,7 @@ \newcommand{\subcref}[1]{\cref{sub@#1}} -\DeclareDocumentCommand{\eqcrefname}{mmo}{ +\NewDocumentCommand{\eqcrefname}{mmo}{ \crefname{#1}{#2}{\IfValueTF{#3}{#3}{#2s}} \creflabelformat{#1}{(##2##1##3)} } @@ -523,11 +570,11 @@ \NewBibliographyString{refname} \NewBibliographyString{refsname} \DefineBibliographyStrings{english}{% - refname = {Reference}, - refsname = {References} + refname = {reference}, + refsname = {references} } \DeclareCiteCommand{\ccite}{% - \ifnum\thecitetotal=1% + \ifnum\thecitetotal=1 \bibstring{refname}% \else% \bibstring{refsname}% @@ -564,67 +611,84 @@ }% }} -\usepackage[excludeor]{everyhook} -\PushPostHook{par}{{\spacefactor=3000}} +\RequirePackage[excludeor]{everyhook} +\newcommand{\begin@sentence}{1001} +\PushPostHook{par}{{\spacefactor=\begin@sentence}} + +\def\frenchspacing{% + \sfcode`\.\begin@sentence \sfcode`\?\begin@sentence + \sfcode`\!\begin@sentence \sfcode`\:\begin@sentence + \sfcode`\;\@m \sfcode`\,\@m +} + \newcommand{\if@begin@of@sentence}[2]{\leavevmode\protecting{% \ifboolexpr{ test {\ifnumcomp{\spacefactor}{=}{3000}} or% - test {\ifnumcomp{\spacefactor}{=}{2000}}% + test {\ifnumcomp{\spacefactor}{=}{2000}} or% + test {\ifnumcomp{\spacefactor}{=}{\begin@sentence}}% }{#1}{#2}% }} -\DeclareDocumentCommand{\acronym}{sommo}{ +\NewDocumentCommand{\acronym}{somsmo}{ \newabbreviation[ - longplural=\IfNoValueTF{#5}{#4s}{#5}, + longplural=\IfNoValueTF{#6}{#5s}{#6}, \glsshortpluralkey=\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} - ]{#3}{\IfNoValueTF{#2}{#3}{#2}}{#4} + ]{#3}{\IfNoValueTF{#2}{#3}{#2}}{#5} \expandafter\newcommand\csname#3\endcsname{% - \if@begin@of@sentence{\cGls{#3}}{\cgls{#3}}\@\xspace% + \if@begin@of@sentence{\cGls{#3}}{\cgls{#3}}% + \IfBooleanTF{#4}{}{\@\xspace}% } \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{% \IfNoValueTF{#2}{#3}{#2} }% } \expandafter\mathdef\csname#3\endcsname{% - \text{\glsxtrshort{#3}}\glsunset{#3}% + \text{\glsxtrshort{#3}}\@gls@increment@currcount{#3}% } \expandafter\newcommand\csname#3s\endcsname{% - \if@begin@of@sentence{\cGlspl{#3}}{\cglspl{#3}}\@\xspace% + \if@begin@of@sentence{\cGlspl{#3}}{\cglspl{#3}}% + \IfBooleanTF{#4}{}{\@\xspace}% } \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% \IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }% } \expandafter\mathdef\csname#3s\endcsname{% - \text{\glsxtrshortpl{#3}}\glsunset{#3}% + \text{\glsxtrshortpl{#3}}\@gls@increment@currcount{#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} +\NewDocumentCommand{\shortacronym}{somsmo}{ + \expandafter\newcommand\csname#3\endcsname{% + \IfNoValueTF{#2}{#3}{#2}\IfBooleanTF{#4}{}{\@\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} + \expandafter\mathdef\csname#3\endcsname{% + \text{\IfNoValueTF{#2}{#3}{#2}}% + } + \expandafter\newcommand\csname#3s\endcsname{% + \IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}}% + \IfBooleanTF{#4}{}{\@\xspace}% + } \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% \IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}} }% } - \expandafter\mathdef\csname#3s\endcsname{\text{\glsxtrshortpl*{#3}}}% - \glsunset{#3} + \expandafter\mathdef\csname#3s\endcsname{% + \text{\IfBooleanTF{#1}{#3}{\IfNoValueTF{#2}{#3s}{#2s}}}% + }% } -\DeclareDocumentCommand{\longacronym}{sommo}{ +\NewDocumentCommand{\longacronym}{somsmo}{ \expandafter\newcommand\csname#3\endcsname{% - \if@begin@of@sentence{\MakeUppercase#4}{#4}\@\xspace% + \if@begin@of@sentence{\MakeUppercase#5}{#5}% + \IfBooleanTF{#4}{}{\@\xspace}% } - \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{#4 }} + \pdfstringdefDisableCommands{\expandafter\def\csname#3\endcsname{#5 }} \expandafter\newcommand\csname#3s\endcsname{% \if@begin@of@sentence{% - \IfNoValueTF{#5}{\MakeUppercase#4s}{\MakeUppercase#5}% + \IfNoValueTF{#6}{\MakeUppercase#5s}{\MakeUppercase#6}% }{% - \IfNoValueTF{#5}{#4s}{#5}}\@\xspace% + \IfNoValueTF{#6}{#5s}{#6}}\IfBooleanTF{#4}{}{\@\xspace}% } \pdfstringdefDisableCommands{\expandafter\def\csname#3s\endcsname{% - \IfNoValueTF{#5}{#4s}{#5} }% + \IfNoValueTF{#6}{#5s}{#6} }% } } \renewcommand*{\@gls@write@entrycounts}{% @@ -646,6 +710,14 @@ } \newcommand{\resetacronym}[1]{\protect\glsreset{#1}} \newcommand{\dummyacronym}[1]{\protect\glsunset{#1}} +\@ifundefined{abstract}{}{% + \let\end@old@abstract\endabstract% + \renewcommand\endabstract{\glsresetall\end@old@abstract}% +} +\let\old@table@of@contents\tableofcontents +\renewcommand\tableofcontents{% + \glsunsetall\old@table@of@contents\glsresetall% +} \fi \endinput |