From c89bf12be0078fc3a2d79c0dc8d2dcc0495a6af7 Mon Sep 17 00:00:00 2001 From: Martin Sievers Date: Mon, 1 Jul 2024 21:43:17 +0200 Subject: [PATCH] Add support for multiple affiliations. Closes #158 --- CHANGELOG.md | 7 ++- lni-author-template.tex | 13 ++--- lni.cls | 80 +++++++++++++++++++------------ lni.dtx | 103 ++++++++++++++++++++++++---------------- 4 files changed, 124 insertions(+), 79 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84bff5f..5bb6f96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ## [Unreleased] +## [1.9] - 2024-07-1 +### Added +- Support for multiple affiliations + ## [1.8.1] - 2024-01-08 ### Changed @@ -167,7 +171,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). First release of the revised files -[Unreleased]: https://github.com/gi-ev/LNI/compare/v1.8.1...HEAD +[Unreleased]: https://github.com/gi-ev/LNI/compare/v1.9...HEAD +[1.9]: https://github.com/gi-ev/LNI/compare/v1.8.1...v1.9 [1.8.1]: https://github.com/gi-ev/LNI/compare/v1.8...v1.8.1 [1.8]: https://github.com/gi-ev/LNI/compare/v1.7...v1.8 [1.7]: https://github.com/gi-ev/LNI/compare/v1.6...v1.7 diff --git a/lni-author-template.tex b/lni-author-template.tex index 411fea0..9a39a2d 100644 --- a/lni-author-template.tex +++ b/lni-author-template.tex @@ -19,12 +19,13 @@ \title[Ein Kurztitel]{Ein sehr langer Titel über mehrere Zeilen mit sehr vielen Worten und noch mehr Buchstaben} %% \subtitle{Untertitel / Subtitle} % if needed -\author[1]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} -\author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000} -\author[1]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} -\author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}% -\affil[1]{Universität\\Abteilung\\Straße\\Postleitzahl Ort\\Land} -\affil[2]{University\\Department\\Address\\Country} + \author[1,2]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} + \author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000} + \author[3]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} + \author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}% + \affil[1]{Universität 1\\Abteilung\\Straße\\Postleitzahl Ort\\Land} + \affil[2]{University 2 \\Department\\Address\\Country} + \affil[3]{University 3\\Department\\Address\\Country} \maketitle \begin{abstract} diff --git a/lni.cls b/lni.cls index dc3f5af..1a98028 100644 --- a/lni.cls +++ b/lni.cls @@ -14,7 +14,7 @@ %% --------| ----------------------------------------------------------------- \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesClass{lni} - [2024/01/08 v1.8.1 Official class for submissions to the ``Lecture Notes + [2024/07/01 v1.9 Official class for submissions to the ``Lecture Notes in Informatics''] \RequirePackage{iftex}\ifluatex\else\pdfoutput=1\fi% \def\@clearglobaloption#1{% @@ -371,53 +371,71 @@ \renewcommand\Authsep{, } \renewcommand\Authands{\iflanguage{ngerman}{ und }{, and }} \renewcommand\Authand{\iflanguage{ngerman}{ und }{ and }} -\renewcommand{\AB@authnote}[1]{$^{\text{\mbox{\normalfont\footnotesize #1}}}$} +\NewDocumentCommand{\multiaffil}{ >{\SplitList{,}} m m m}{% + \gdef\@currEmail{#2} + \gdef\@currOrcid{#3} + \ProcessList{#1}{\@multiaffil} +} + +\newcommand{\@multiaffil}[1]{% + \ifcsundef{@emailsandorcids#1}{\csgdef{@emailsandorcids#1}{}}{}% + \ifcsempty{@emailsandorcids#1}% + {\csgappto{@emailsandorcids#1}{% + \if\relax\@currEmail\relax\else\email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}% + {\csgappto{@emailsandorcids#1}{% + \if\relax\@currEmail\relax\else;\ \email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}% +} + \renewcommand\author[4][]{% \ifnewaffil\addtocounter{affil}{1}% \edef\AB@thenote{\arabic{affil}}% \fi% \if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}% - \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% \setcounter{Maxaffil}{0}\fi \ifnum\value{authors}=0\def\@firstauthor{#2}\fi \ifnum\value{authors}>1\relax - \@namedef{@sep\number\c@authors}{\Authsep}\fi + \@namedef{@sep\number\c@authors}{\Authsep}\fi \addtocounter{authors}{1}% \begingroup - \let\protect\@unexpandable@protect \let\and\AB@pand - \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}% - \@temptokena=\expandafter{\AB@authors}% - \@temptokenb=\expandafter{\AB@authors}% - {\def\\{\protect\\[\@affilsep]\protect\Affilfont - \protect\AB@resetsep}% - \xdef\AB@author{\AB@blk@and#2}% - \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}% - \xdef\AB@authors{\the\@temptokena\AB@blk@and}% - \else - \xdef\AB@authors{\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{\AB@authlist}% - \@temptokenb=\expandafter{\@authlisthead}% - \let\\=\authorcr - \xdef\AB@authlist{\the\@temptokena - \protect\@nameuse{@sep\number\c@authors}% - \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}% - \xdef\@authlisthead{\the\@temptokenb - \protect\@nameuse{@sep\number\c@authors}% - \protect\Authfont#2}% + \let\protect\@unexpandable@protect \let\and\AB@pand + \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}% + \@temptokena=\expandafter{\AB@authors}% + \@temptokenb=\expandafter{\AB@authors}% + {\def\\{\protect\\[\@affilsep]\protect\Affilfont + \protect\AB@resetsep}% + \xdef\AB@author{\AB@blk@and#2}% + \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}% + \xdef\AB@authors{\the\@temptokena\AB@blk@and}% + \else + \xdef\AB@authors{\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{\AB@authlist}% + \@temptokenb=\expandafter{\@authlisthead}% + \let\\=\authorcr + \xdef\AB@authlist{\the\@temptokena + \protect\@nameuse{@sep\number\c@authors}% + \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}% + \xdef\@authlisthead{\the\@temptokenb + \protect\@nameuse{@sep\number\c@authors}% + \protect\Authfont#2}% \endgroup \ifnum\value{authors}>2\relax \@namedef{@sep\number\c@authors}{\Authands}\fi + \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% + \sbox\z@{\@tempcnta=0#1\relax}% + \expandafter\ifdim\wd\z@>\z@\relax + \multiaffil{#1}{#3}{#4} + \else + \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% \ifcsempty{@emailsandorcids\AB@note}% {\csgappto{@emailsandorcids\AB@note}{% - \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}% - }% + \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}% {\csgappto{@emailsandorcids\AB@note}{% \if\relax#3\relax\else;\ \email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}% - + \fi% \newaffilfalse } \renewcommand\@author{% diff --git a/lni.dtx b/lni.dtx index 2026123..257f0d4 100644 --- a/lni.dtx +++ b/lni.dtx @@ -134,7 +134,7 @@ This work consists of the file lni.dtx %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesClass{lni} %<*class> - [2024/01/08 v1.8.1 Official class for submissions to the ``Lecture Notes + [2024/07/01 v1.9 Official class for submissions to the ``Lecture Notes in Informatics''] % %<*driver> @@ -286,6 +286,7 @@ This work consists of the file lni.dtx % \changes{v1.8}{2022/06/10}{Fix output error in bst files (#97)} % \changes{v1.8}{2022/11/25}{Make class compatable with latest publisher requirements (#121)} % \changes{v1.8}{2022/11/25}{Make usage of `hyperref` mandatory (#131)} +% \changes{v1.9}{2024/07/01}{Support multiple affiliations (#158)} % % \GetFileInfo{\jobname.dtx} % \DoNotIndex{\newcommand,\newenvironment} @@ -489,12 +490,13 @@ This work consists of the file lni.dtx % \cs{affil\oarg{number}\marg{information}} where you can use % \texttt{\textbackslash\textbackslash} to split the address. % \begin{examplecode}[label={lst:author}] -% \author[1]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} +% \author[1,2]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} % \author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000} -% \author[1]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} +% \author[3]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} % \author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}% -% \affil[1]{Universität\\Abteilung\\Straße\\Postleitzahl Ort\\Land} -% \affil[2]{University\\Department\\Address\\Country} +% \affil[1]{Universität 1\\Abteilung\\Straße\\Postleitzahl Ort\\Land} +% \affil[2]{University 2 \\Department\\Address\\Country} +% \affil[3]{University 3\\Department\\Address\\Country} % \end{examplecode} % % Leave the third and/or fourth argument empty if there is no email address and/or ORCID iD. @@ -1149,53 +1151,71 @@ This work consists of the file lni.dtx \renewcommand\Authsep{, } \renewcommand\Authands{\iflanguage{ngerman}{ und }{, and }} \renewcommand\Authand{\iflanguage{ngerman}{ und }{ and }} -\renewcommand{\AB@authnote}[1]{$^{\text{\mbox{\normalfont\footnotesize #1}}}$} +\NewDocumentCommand{\multiaffil}{ >{\SplitList{,}} m m m}{% + \gdef\@currEmail{#2} + \gdef\@currOrcid{#3} + \ProcessList{#1}{\@multiaffil} +} + +\newcommand{\@multiaffil}[1]{% + \ifcsundef{@emailsandorcids#1}{\csgdef{@emailsandorcids#1}{}}{}% + \ifcsempty{@emailsandorcids#1}% + {\csgappto{@emailsandorcids#1}{% + \if\relax\@currEmail\relax\else\email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}% + {\csgappto{@emailsandorcids#1}{% + \if\relax\@currEmail\relax\else;\ \email{\@currEmail}\fi\if\relax\@currOrcid\relax\else,\ \orcid{\@currOrcid}\fi}}% +} + \renewcommand\author[4][]{% \ifnewaffil\addtocounter{affil}{1}% \edef\AB@thenote{\arabic{affil}}% \fi% \if\relax#1\relax\def\AB@note{\AB@thenote}\else\def\AB@note{#1}% - \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% \setcounter{Maxaffil}{0}\fi \ifnum\value{authors}=0\def\@firstauthor{#2}\fi \ifnum\value{authors}>1\relax - \@namedef{@sep\number\c@authors}{\Authsep}\fi + \@namedef{@sep\number\c@authors}{\Authsep}\fi \addtocounter{authors}{1}% \begingroup - \let\protect\@unexpandable@protect \let\and\AB@pand - \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}% - \@temptokena=\expandafter{\AB@authors}% - \@temptokenb=\expandafter{\AB@authors}% - {\def\\{\protect\\[\@affilsep]\protect\Affilfont - \protect\AB@resetsep}% - \xdef\AB@author{\AB@blk@and#2}% - \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}% - \xdef\AB@authors{\the\@temptokena\AB@blk@and}% - \else - \xdef\AB@authors{\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{\AB@authlist}% - \@temptokenb=\expandafter{\@authlisthead}% - \let\\=\authorcr - \xdef\AB@authlist{\the\@temptokena - \protect\@nameuse{@sep\number\c@authors}% - \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}% - \xdef\@authlisthead{\the\@temptokenb - \protect\@nameuse{@sep\number\c@authors}% - \protect\Authfont#2}% + \let\protect\@unexpandable@protect \let\and\AB@pand + \def\thanks{\protect\thanks}\def\footnote{\protect\footnote}% + \@temptokena=\expandafter{\AB@authors}% + \@temptokenb=\expandafter{\AB@authors}% + {\def\\{\protect\\[\@affilsep]\protect\Affilfont + \protect\AB@resetsep}% + \xdef\AB@author{\AB@blk@and#2}% + \ifnewaffil\gdef\AB@las{}\gdef\AB@lasx{\protect\Authand}\gdef\AB@as{}% + \xdef\AB@authors{\the\@temptokena\AB@blk@and}% + \else + \xdef\AB@authors{\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{\AB@authlist}% + \@temptokenb=\expandafter{\@authlisthead}% + \let\\=\authorcr + \xdef\AB@authlist{\the\@temptokena + \protect\@nameuse{@sep\number\c@authors}% + \protect\Authfont#2\if\relax#4\relax\else\,\orcidlink{#4}\fi\AB@authnote{\AB@note}}% + \xdef\@authlisthead{\the\@temptokenb + \protect\@nameuse{@sep\number\c@authors}% + \protect\Authfont#2}% \endgroup \ifnum\value{authors}>2\relax \@namedef{@sep\number\c@authors}{\Authands}\fi + \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% + \sbox\z@{\@tempcnta=0#1\relax}% + \expandafter\ifdim\wd\z@>\z@\relax + \multiaffil{#1}{#3}{#4} + \else + \ifcsundef{@emailsandorcids\AB@note}{\csgdef{@emailsandorcids\AB@note}{}}{}% \ifcsempty{@emailsandorcids\AB@note}% {\csgappto{@emailsandorcids\AB@note}{% - \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}% - }% + \if\relax#3\relax\else\email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}% {\csgappto{@emailsandorcids\AB@note}{% \if\relax#3\relax\else;\ \email{#3}\fi\if\relax#4\relax\else,\ \orcid{#4}\fi}}% - + \fi% \newaffilfalse } \renewcommand\@author{% @@ -3071,12 +3091,13 @@ EXECUTE {end.bib} \title[Ein Kurztitel]{Ein sehr langer Titel über mehrere Zeilen mit sehr vielen Worten und noch mehr Buchstaben} %% \subtitle{Untertitel / Subtitle} % if needed -\author[1]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} -\author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000} -\author[1]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} -\author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}% -\affil[1]{Universität\\Abteilung\\Straße\\Postleitzahl Ort\\Land} -\affil[2]{University\\Department\\Address\\Country} + \author[1,2]{Firstname1 Lastname1}{firstname1.lastname1@affiliation1.org}{0000-0000-0000-0000} + \author[2]{Firstname2 Lastname2}{firstname2.lastname2@affiliation2.org}{0000-0000-0000-0000} + \author[3]{Firstname3 Lastname3}{firstname3.lastname3@affiliation1.org}{0000-0000-0000-0000} + \author[1]{Firstname4 Lastname4}{firstname4.lastname4@affiliation1.org}{0000-0000-0000-0000}% + \affil[1]{Universität 1\\Abteilung\\Straße\\Postleitzahl Ort\\Land} + \affil[2]{University 2 \\Department\\Address\\Country} + \affil[3]{University 3\\Department\\Address\\Country} \maketitle \begin{abstract}