summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty61
1 files changed, 49 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty b/Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty
index 0f08eed2e6f..edc044ec635 100644
--- a/Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty
+++ b/Master/texmf-dist/tex/xelatex/langsci/langsci-affiliations.sty
@@ -44,9 +44,10 @@
%% ------------------------------------------------------------------------------
+
\RequirePackage{xparse}
\ProvidesExplPackage {langsci-affiliations}
-{2021-02-17} {1.0.1}
+{2021-11-30} {1.0.4}
{A LaTeX3 package to collect and order authors and affiliations}
\NewDocumentCommand{\ResolveAffiliations}{ O{} +m }
@@ -57,6 +58,14 @@
\group_end:
}
+\NewExpandableDocumentCommand{\CountAuthorsFromAffiliations}{ O{} +m }
+ {%
+ \group_begin:
+ \keys_set:nn { affiliations } { #1 }%
+ \exp_args:No \affiliations_count_authors:n { #2 }%
+ \group_end:
+ }
+
\NewDocumentCommand{\SetupAffiliations}{ m }
{%
\keys_set:nn { affiliations } { #1 }
@@ -111,9 +120,12 @@
\cs_generate_variant:Nn \prop_put:Nnn { Nxx }
\cs_generate_variant:Nn \prop_put:Nnn { Nnx }
+\cs_generate_variant:Nn \seq_set_split:Nnn { NVV }
\cs_generate_variant:Nn \seq_set_split:Nnn { NVn }
+\cs_generate_variant:Nn \tl_replace_all:Nnn { NnV }
\clist_new:N \l__affiliations_tmpa_clist
\int_new:N \l__affiliations_tmpa_int
+\int_new:N \g__affiliations_num_authors_int
\prop_new:N \l__affiliations_tmpa_prop
\seq_new:N \l__affiliations_affiliations_seq
\seq_new:N \l__affiliations_authors_seq
@@ -122,6 +134,7 @@
\seq_new:N \l__affiliations_tmpb_seq
\tl_new:N \l__affiliations_tmpa_tl
\tl_new:N \l__affiliations_tmpb_tl
+\tl_new:N \l__affiliations_tmpc_tl
\prop_new:N \l__affiliations_output_prop
\prop_new:N \l__affiliations_affiliations_prop
\prop_const_from_keyval:Nn \l__affiliations_icons_prop
@@ -189,7 +202,7 @@
}
{none} { }
}
- ##1 ~
+ \tl_rescan:nn {} {##1} ~
}
}
\cs_new:Npn \__affiliations_return_afil_text:n #1
@@ -243,9 +256,13 @@
\cs_new:Npn \affiliations_resolve:n #1
{
- \seq_set_split:NVn \l__affiliations_names_seq
+ \tl_set:Nn \l__affiliations_tmpc_tl { #1 }
+ \tl_replace_all:NnV \l__affiliations_tmpc_tl
+ { \and }
+ \l__affiliations_input_names_sep_tl
+ \seq_set_split:NVV \l__affiliations_names_seq
\l__affiliations_input_names_sep_tl
- { #1 }
+ \l__affiliations_tmpc_tl
\seq_map_inline:Nn \l__affiliations_names_seq
{
\seq_clear_new:N \l__affiliations_names_tmp_seq
@@ -271,17 +288,25 @@
\group_end:
}
{
+ \seq_clear:N \l__affiliations_tmpa_seq
\prop_map_inline:Nn \l__affiliations_tmpa_prop
{
- \__affiliations_output_authors_font:
- \tl_rescan:nn {} {##1}\\[0.5ex]
- \group_begin:
- \__affiliations_output_affiliation_font:
- \tl_rescan:nn {} {##2}
- \group_end:
- \medskip\\
+ \seq_put_right:Nx \l__affiliations_tmpa_seq
+ {
+ \group_begin:
+ \exp_not:N \__affiliations_output_authors_font:
+ \tl_rescan:nn {} {##1}\\[0.5ex]
+ \group_end:
+ \group_begin:
+ \exp_not:N \__affiliations_output_affiliation_font:
+ \tl_rescan:nn {} {##2}
+ \group_end:
+ }
}
- \vspace*{-\baselineskip-\medskipamount}
+ \seq_use:Nnnn \l__affiliations_tmpa_seq
+ {\l__affiliations_separator_between_two_tl}
+ {\l__affiliations_separator_between_mult_tl}
+ {\l__affiliations_separator_between_last_two_tl}
}
}
{
@@ -300,6 +325,18 @@
\group_end:
}
}
+\cs_new:Npn \affiliations_count_authors:n #1
+ {
+ \tl_set:Nn \l__affiliations_tmpc_tl { #1 }
+ \tl_replace_all:NnV \l__affiliations_tmpc_tl
+ { \and }
+ \l__affiliations_input_names_sep_tl
+ \seq_set_split:NVV \l__affiliations_names_seq
+ \l__affiliations_input_names_sep_tl
+ \l__affiliations_tmpc_tl
+ \int_gset:Nn \g__affiliations_num_authors_int
+ { \seq_count:N \l__affiliations_names_seq }
+ }
%%
%%