Skip to content

Commit

Permalink
new option 'separator between indices'
Browse files Browse the repository at this point in the history
Can be used to separate multiple affiliations by a single author
when no index is in use.
  • Loading branch information
kopeckyf committed Oct 12, 2023
1 parent 01bff5c commit 44a719e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 38 deletions.
85 changes: 47 additions & 38 deletions langsci-affiliations.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package is probably of only limited use to document authors/end users.
langsci-affiliations was developed at Language Science Press to help in the
production of scientific texts in linguistics.

Copyright (C) 2022 by Felix Kopecky, Language Science Press
Copyright (C) 2023 by Felix Kopecky, Language Science Press

This work consists of the file langsci-affiliations.dtx
and the derived files langsci-affiliations.sty,
Expand Down Expand Up @@ -78,7 +78,7 @@ Please report any bugs or feature requests to
% Please submit bug reports and feature requests to
% \protect\url{https://github.com/langsci/langsci-affiliations/issues}.
% }}
% \date{Version 1.1 -- \today}
% \date{Version 1.2 -- \today}
% \maketitle
% \frenchspacing
% \begin{documentation}
Expand Down Expand Up @@ -111,39 +111,12 @@ Please report any bugs or feature requests to
% \noindent The output can be customised using the \oarg{options}. They are described below.
% \end{function}

% \begin{function}[added=2021-12-06]{\CountAuthorsFromAffiliations}
% \begin{syntax}
% \cs{CountAuthorsFromAffiliations} \oarg{options} \marg{pairs of authors and affiliations}
% \end{syntax}
% A document command to count the numbers of authors given in a list. Useful
% for conditional behaviour of document classes based on the numbers of authors.
% It takes the same optional arguments as \cmd{\ResolveAffiliations}. For example,
% a custom author separator is recognised by this command.
%
% The result is stored in the global integer variable \cs{g__affiliations_num_authors_int}.
% \end{function}

% \begin{function}[added=2022-09-27]{\LinkToORCIDinAffiliations}
% \begin{syntax}
% \cs{LinkToORCIDinAffiliations} \marg{orcid}
% \end{syntax}
% This document command is intended as a user interface to customise the way
% ORCIDs are output. For example, it can be set to forward the input ORCIDs to
% \cs{orcidlink} from the \pkg{orcidlink} package:
%
% \begin{verbatim}
% \RenewDocumentCommand{\LinkToORCIDinAffiliations}{ +m }
% {%
% \,\orcidlink{#1}%
% }
% \end{verbatim}
% \end{function}

% \begin{function}{\SetupAffiliations}
% \begin{syntax}
% \cs{SetupAffiliations} \marg{options}
% \end{syntax}
% Options can be set either globally or locally. With \cs{SetupAffiliations}\marg{options}, they apply globally. If they are set with \cs{ResolveAffiliations}\oarg{options}, they apply locally.
% \end{function}
%
% \begin{description}[style=nextline]
% \item[|mark style =| \meta{style}\hfill (initially |alphabetic|)] Controls which markers should be used in the indexes of affiliations. Can be a either of \{|alphabetic|, |numeric|, |circled|, |none|\}.
Expand All @@ -163,8 +136,10 @@ Please report any bugs or feature requests to
% If there are more than two authors, use these \meta{tokens} to separate every pair except the last one.
% \item[|separator between final two =| \meta{tokens}\hfill (initially |\char`~\&\char`~|)]
% Use these \meta{tokens} to separate the last pair of authors if ther are more than two.
% \item[|separator between affiliations =| \meta{tokens}\hfill (initially |,|)]
% Use these to separate affiliations after each author. The affiliations in the affiliation line are always separated by a space.
% \item[|separator between indices =| \meta{tokens}\hfill (initially |,|)]
% Use these to separate affiliation indices after each author.
% \item[|separator between affiliations =| \meta{tokens}\hfill (initially |\textvisiblespace |)]
% Separates the affiliations in the affiliation line.
% \end{description}
%
% \noindent The way the input is digested can be customised with these two settings:
Expand All @@ -175,11 +150,36 @@ Please report any bugs or feature requests to
% \item[|input affiliation separator =| \meta{tokens}\hfill (intially |;|)]
% Separates the affiliations in the input, within dummy command \cs{affiliation}.
% \end{description}
%
% \begin{function}[added=2021-12-06]{\CountAuthorsFromAffiliations}
% \begin{syntax}
% \cs{CountAuthorsFromAffiliations} \oarg{options} \marg{pairs of authors and affiliations}
% \end{syntax}
% A document command to count the numbers of authors given in a list. Useful
% for conditional behaviour of document classes based on the numbers of authors.
% It takes the same optional arguments as \cmd{\ResolveAffiliations}. For example,
% a custom author separator is recognised by this command.
%
% The result is stored in the global integer variable \cs{g__affiliations_num_authors_int}.
% \end{function}

% \begin{function}[added=2022-09-27]{\LinkToORCIDinAffiliations}
% \begin{syntax}
% \cs{LinkToORCIDinAffiliations} \marg{orcid}
% \end{syntax}
% This document command is intended as a user interface to customise the way
% ORCIDs are output. For example, it can be set to forward the input ORCIDs to
% \cs{orcidlink} from the \pkg{orcidlink} package:
%
% \begin{verbatim}
% \RenewDocumentCommand{\LinkToORCIDinAffiliations}{ +m }
% {%
% \,\orcidlink{#1}%
% }
% \end{verbatim}
% \end{function}
% \end{documentation}
%
% \newpage
% \end{documentation}
%
% \begin{implementation}
% \section{Implementation}
Expand All @@ -192,7 +192,7 @@ Please report any bugs or feature requests to
% \begin{macrocode}
\RequirePackage{xparse}
\ProvidesExplPackage {langsci-affiliations}
{2022-10-11} {1.1}
{2023-10-12} {1.2}
{A LaTeX3 package to collect and order authors and affiliations}
% \end{macrocode}

Expand Down Expand Up @@ -270,10 +270,14 @@ Please report any bugs or feature requests to
= \l__affiliations_separator_between_last_two_tl,
separator~between~final~two .initial:n
= {~\&~},
separator~between~indices .tl_set:N
= \l__affiliations_indices_separator_tl,
separator~between~indices .initial:n
= {,},
separator~between~affiliations .tl_set:N
= \l__affiliations_afil_separator_tl,
separator~between~affiliations .initial:n
= {,},
= {~},
output~authors~font .cs_set:Np
= \__affiliations_output_authors_font:,
output~authors~font .initial:n
Expand Down Expand Up @@ -416,7 +420,12 @@ Please report any bugs or feature requests to
}
{none} { }
}
\tl_rescan:nn {} {##1} ~
\tl_rescan:nn {} {##1}
\int_compare:nNnT
{ \int_eval:n {\l__affiliations_tmpa_int + 1} }
<
{ \prop_count:N \l__affiliations_affiliations_prop }
{ \tl_use:N \l__affiliations_afil_separator_tl }
}
}
% \end{macrocode}
Expand Down Expand Up @@ -464,7 +473,7 @@ Please report any bugs or feature requests to
\tl_set:Nn \l__affiliations_tmpb_tl
{
\seq_use:Nn \l__affiliations_tmpb_seq
{\l__affiliations_afil_separator_tl}
{\l__affiliations_indices_separator_tl}
}
\str_case_e:nn { \l__affiliations_orcid_place_tl }
{
Expand Down
Binary file modified langsci-affiliations.pdf
Binary file not shown.

0 comments on commit 44a719e

Please sign in to comment.