diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/affilauthor/affilauthor.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/affilauthor/affilauthor.sty | 224 |
1 files changed, 224 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/affilauthor/affilauthor.sty b/Master/texmf-dist/tex/latex/affilauthor/affilauthor.sty new file mode 100644 index 00000000000..65fccd556e9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/affilauthor/affilauthor.sty @@ -0,0 +1,224 @@ +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\ProvidesPackage{affilauthor}[2023/11/05 1.0.0] + +\RequirePackage{marvosym} + +\ExplSyntaxOn + +\tl_new:N \l__affauth_tmpa_tl +\tl_new:N \l__affauth_tmpb_tl +\int_new:N \l__affauth_tmpa_int +\int_new:N \l__affauth_tmpb_int +\bool_new:N \l__affauth_tmpa_bool +\bool_new:N \l__affauth_tmpb_bool +\seq_new:N \l__affauth_tmpa_seq +\seq_new:N \l__affauth_tmpb_seq + +\tl_new:N \l__affauth_auth_name_tl +\tl_new:N \l__affauth_auth_mail_tl +\tl_new:N \l__affauth_auth_phone_tl +\tl_new:N \l__affauth_auth_url_tl +\tl_new:N \l__affauth_auth_note_tl +\tl_new:N \l__affauth_auth_affil_id_tl + +\tl_new:N \l__affauth_font_author_tl +\tl_new:N \l__affauth_font_affil_tl +\tl_new:N \l__affauth_font_mail_tl +\tl_new:N \l__affauth_font_url_tl +\tl_new:N \l__affauth_font_phone_tl +\tl_new:N \l__affauth_font_note_tl +\tl_new:N \l__affauth_font_note_num_tl + +\tl_new:N \l__affauth_aff_id_tl +\tl_new:N \l__affauth_aff_div_tl +\tl_new:N \l__affauth_aff_org_tl +\tl_new:N \l__affauth_aff_addr_tl +\tl_new:N \l__affauth_aff_street_tl +\tl_new:N \l__affauth_aff_landmark_tl +\tl_new:N \l__affauth_aff_pincode_tl +\tl_new:N \l__affauth_aff_postbox_tl +\tl_new:N \l__affauth_aff_city_tl +\tl_new:N \l__affauth_aff_state_tl +\tl_new:N \l__affauth_aff_country_tl + +\seq_new:N \l__affauth_author_info_seq +\prop_new:N \l__affauth_author_id_prop +\seq_new:N \l__affauth_affil_info_seq +\int_new:N \l__affauth_author_cnt_int +\int_new:N \l__affauth_affil_cnt_int +\int_new:N \l__affauth_author_note_int + +\skip_new:N \__affauth_before_affil_skip +\skip_new:N \__affauth_before_auth_skip + +\skip_set:Nn \__affauth_before_affil_skip {2\baselineskip} +\skip_set:Nn \__affauth_before_auth_skip {0pt} + +\keys_define:nn { author-info } + { + name .tl_set:N = \l__affauth_name_tl, + mail .tl_set:N = \l__affauth_auth_mail_tl, + url .tl_set:N = \l__affauth_auth_url_tl, + phone .tl_set:N = \l__affauth_auth_phone_tl, + note .tl_set:N = \l__affauth_auth_note_tl, + affil .tl_set:N = \l__affauth_auth_affil_id_tl + } + +\keys_define:nn { affil-info } + { + id .tl_set:N = \l__affauth_aff_id_tl, + div .tl_set:N = \l__affauth_aff_div_tl, + org .tl_set:N = \l__affauth_aff_org_tl, + addr .tl_set:N = \l__affauth_aff_addr_tl, + street .tl_set:N = \l__affauth_aff_street_tl, + landmark .tl_set:N = \l__affauth_aff_landmark_tl, + pincode .tl_set:N = \l__affauth_aff_pincode_tl, + postbox .tl_set:N = \l__affauth_aff_postbox_tl, + city .tl_set:N = \l__affauth_aff_city_tl, + state .tl_set:N = \l__affauth_aff_state_tl, + country .tl_set:N = \l__affauth_aff_country_tl + } + +\keys_define:nn { style-format } + { + authfont .tl_set:N = \l__affauth_font_author_tl, + affilfont .tl_set:N = \l__affauth_font_affil_tl, + mailfont .tl_set:N = \l__affauth_font_mail_tl, + urlfont .tl_set:N = \l__affauth_font_url_tl, + phonefont .tl_set:N = \l__affauth_font_phone_tl, + notefont .tl_set:N = \l__affauth_font_note_tl, + notenum .choices:nn = { alpha, fnsym, roman } + { + \int_case:nn {\l_keys_choice_int} + { + {1}{\let\l__affauth_note:n\@alph} + {2}{\let\l__affauth_note:n\@fnsymbol} + {3}{\let\l__affauth_note:n\@roman} + } + }, + authspace. skip_set:N = \__affauth_before_auth_skip, + affilspace. skip_set:N = \__affauth_before_affil_skip + } + + +\NewDocumentCommand{\affilstyle}{O{}} {\keys_set:nn { style-format } { #1 }} + +\cs_set_protected:Nn \__affauth_aff_id:n + { + \group_begin: + \seq_set_split:Nxx \l__affauth_tmpa_seq {,} {#1} + \seq_clear:N \l__affauth_tmpb_seq + \seq_map_inline:Nn \l__affauth_tmpa_seq + { + \prop_if_in:NeT \l__affauth_author_id_prop {##1} + { + \prop_get:NeN \l__affauth_author_id_prop {##1} \l__affauth_tmpb_tl + \seq_put_right:NV \l__affauth_tmpb_seq \l__affauth_tmpb_tl + } + } + \seq_sort:Nn \l__affauth_tmpb_seq + { + \int_compare:nNnTF {##1} < {##2} + {\sort_return_same:}{\sort_return_swapped:} + } + \textsuperscript{\seq_use:Nn \l__affauth_tmpb_seq {,}} + \group_end: + } + +\cs_set:Nn \__affauth_auth_sep:n {} + +\cs_set_protected:Nn \__affauth_aff_number:n + { + \int_compare:nNnT {#1} > {1} {\par} + \textsuperscript{#1}\thinspace + } + +\cs_set_protected:Nn \l__affauth_note:n {\ifcase#1\or *\or + **\or***\or****\or\#\or\#\#\or\#\#\#\or\#\#\#\#\or\$\or\$\$\or\$\$\$\or\$\$\$\$ + \or\dag\or\dag\dag\or\dag\dag\dag\or\dag\dag\dag\dag\or\ddag\or\ddag\ddag\or\ddag\ddag\ddag\or\ddag\ddag\ddag\ddag\fi} + +\cs_set_protected:Nn \__affauth_auth_mail:nnnn + { + \group_begin: + \seq_clear:N \l__affauth_tmpa_seq + \tl_if_empty:nF {#1} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_mail_tl\Letter\thinspace\exp_not:n{#1}}}} + \tl_if_empty:nF {#2} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_phone_tl\Telefon\thinspace\exp_not:n{#2}}}} + \tl_if_empty:nF {#3} {\seq_put_right:Nn \l__affauth_tmpa_seq {{\l__affauth_font_url_tl\Mundus\thinspace\exp_not:n{#3}}}} + \seq_if_empty:NF \l__affauth_tmpa_seq + { + \group_begin: + \int_gincr:N \l__affauth_author_note_int + \textsuperscript{,\l__affauth_note:n{\l__affauth_author_note_int}} + \cs_set:Npn \thefootnote {} + \footnotetext[0]{\leftskip-\parindent\l__affauth_note:n{\l__affauth_author_note_int}\thinspace\seq_use:Nn \l__affauth_tmpa_seq {,\space}} + \group_end: + } + \tl_if_empty:nF {#4} + { + \group_begin: + \int_gincr:N \l__affauth_author_note_int + \textsuperscript{,\l__affauth_note:n{\l__affauth_author_note_int}} + \cs_set:Npn \thefootnote {} + \footnotetext[0]{\leftskip-\parindent{\l__affauth_font_note_tl\l__affauth_note:n{\l__affauth_author_note_int}\thinspace\exp_not:n{#4}}} + \group_end: + } + \group_end: + } + +\cs_set_protected:Npn \author #1 + { + \group_begin: + \int_gincr:N \l__affauth_author_cnt_int + \keys_set:nn { author-info } { #1 } + \seq_gput_right:Ne \l__affauth_author_info_seq + { + \l__affauth_name_tl + \exp_args:NV \__affauth_aff_id:n \l__affauth_auth_affil_id_tl + \__affauth_auth_mail:nnnn {\l__affauth_auth_mail_tl} {\l__affauth_auth_phone_tl} {\l__affauth_auth_url_tl} {\l__affauth_auth_note_tl} + \exp_args:NV \__affauth_auth_sep:n \l__affauth_author_cnt_int + } + \group_end: + } + +\cs_set_protected:Npn \affil #1 + { + \group_begin: + \int_gincr:N \l__affauth_affil_cnt_int + \keys_set:nn { affil-info } { #1 } + \prop_gput:NVV \l__affauth_author_id_prop \l__affauth_aff_id_tl \l__affauth_affil_cnt_int + \seq_gput_right:Ne \l__affauth_affil_info_seq + { + \exp_args:NV \__affauth_aff_number:n \l__affauth_affil_cnt_int + \tl_if_empty:NF \l__affauth_aff_div_tl \l__affauth_aff_div_tl + \tl_if_empty:NF \l__affauth_aff_org_tl {,\space} \l__affauth_aff_org_tl + \tl_if_empty:NF \l__affauth_aff_addr_tl {,\space} \l__affauth_aff_addr_tl + \tl_if_empty:NF \l__affauth_aff_street_tl {,\space} \l__affauth_aff_street_tl + \tl_if_empty:NF \l__affauth_aff_landmark_tl {,\space} \l__affauth_aff_landmark_tl + \tl_if_empty:NF \l__affauth_aff_pincode_tl {,\space} \l__affauth_aff_pincode_tl + \tl_if_empty:NF \l__affauth_aff_postbox_tl {,\space} \l__affauth_aff_postbox_tl + \tl_if_empty:NF \l__affauth_aff_city_tl {,\space} \l__affauth_aff_city_tl + \tl_if_empty:NF \l__affauth_aff_state_tl {,\space} \l__affauth_aff_state_tl + \tl_if_empty:NF \l__affauth_aff_country_tl {,\space} \l__affauth_aff_country_tl + } + \group_end: + } + +\let\org@maketitle=\maketitle +\def\maketitle + {{\renewenvironment{tabular}[2][]{\begin{center}} + {\end{center}} + \org@maketitle} + } + +\AtBeginDocument{ + \gdef\@author + { + \group_begin: + \vskip\__affauth_before_auth_skip + {\l__affauth_font_author_tl\seq_use:Nnnn \l__affauth_author_info_seq {\space and\space}{,\space}{,\space and\space}} + \par\vskip\__affauth_before_affil_skip + {\l__affauth_font_affil_tl\seq_use:Nn \l__affauth_affil_info_seq {\par}} + \group_end: + } + } +\ExplSyntaxOff
\ No newline at end of file |