diff options
author | Karl Berry <karl@freefriends.org> | 2020-08-26 21:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-08-26 21:11:59 +0000 |
commit | 2f8ba2684ef82c68c8c56bdcc9ffdd4d079417b0 (patch) | |
tree | c54939270fffdad50efeeb3948b3b905c089b2ca /Master/texmf-dist/tex/latex/qrbill | |
parent | 7b5487090fb9724487b2821fa71e4f5f330e7d66 (diff) |
qrbill (26aug20)
git-svn-id: svn://tug.org/texlive/trunk@56190 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/qrbill')
-rw-r--r-- | Master/texmf-dist/tex/latex/qrbill/qrbill.sty | 55 |
1 files changed, 48 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/latex/qrbill/qrbill.sty b/Master/texmf-dist/tex/latex/qrbill/qrbill.sty index ff602b56172..ec784ae5bbe 100644 --- a/Master/texmf-dist/tex/latex/qrbill/qrbill.sty +++ b/Master/texmf-dist/tex/latex/qrbill/qrbill.sty @@ -38,7 +38,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \RequirePackage{expl3} -\ProvidesExplPackage{qrbill}{2020/06/28}{1.0}{ +\ProvidesExplPackage{qrbill}{2020/08/25}{1.02}{ Template for QR-bills based on the Swiss Payment Standards } \RequirePackage{iftex} @@ -124,7 +124,7 @@ separate / text .code:n = { \bool_gset_true:N \g__qrbill_separateinfo_bool \cs_set:Nn \qrbill_print_separate_info: { - \centerline{\footnotesize\qrbillseparatename} + \centerline{\raisebox{\dimexpr\depth+.3ex\relax}[0pt][0pt]{\footnotesize\qrbillseparatename}} \par\nointerlineskip \rule{\c_qrbill_width_dim}{\g__qrbill_rule_dim} } @@ -132,6 +132,14 @@ , separate / false .code:n = {\bool_gset_false:N \g__qrbill_separateinfo_bool}, separate .initial:n = text, + sep-iban .int_gset:N = \g__qrbill_ibansep_int, + sep-iban .initial:n = 0, + ibanseperator .tl_gset:N = \g__qrbill_ibansep_tl, + ibanseperator .initial:n = {\,}, + sep-reference .int_gset:N = \g__qrbill_referencesep_int, + sep-reference .initial:n = 0, + referenceseperator .tl_gset:N = \g__qrbill_referencesep_tl, + referenceseperator .initial:n = {\,} } \ProcessKeysOptions{qrbill} @@ -228,14 +236,16 @@ \vbox_to_ht:nn {56mm}{ {\qrbill_headingR_font:\qrbillaccountname\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl\par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingR_font:\qrbillreferencename\par} { - \qrbill_valueR_font:\tl_use:c {l_qrbill_data_Reference_tl} + \qrbill_valueR_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip } } @@ -278,7 +288,7 @@ \skip_horizontal:n {2\c_qrbill_sep_dim} \begin{minipage}[c][95mm][t]{138mm} \begin{minipage}[c][85mm][t]{51mm} - {\qrbill_title_font:\qrbillpaymentpartname} + \parbox[t][7mm][t]{\linewidth}{\qrbill_title_font:\qrbillpaymentpartname} \par\nointerlineskip \skip_vertical:n {\c_qrbill_sep_dim} \qrcode_setup_QRcode: @@ -314,13 +324,15 @@ \par\nointerlineskip {\qrbill_headingP_font:\qrbillaccountname\par} { - \qrbill_valueP_font:\tl_use:c {l_qrbill_data_Account_tl}\par + \qrbill_valueP_font: + \__qrbill_sep_tl:nV {iban} \l_qrbill_data_Account_tl \par \qrbill_insert_address:N \g__qrbill_creditorprefix_tl \par\vskip\baselineskip } \tl_if_empty:NF \l_qrbill_data_Reference_tl { {\qrbill_headingP_font:\qrbillreferencename\par} - {\qrbill_valueP_font:\tl_use:c {l_qrbill_data_Reference_tl} + {\qrbill_valueP_font: + \__qrbill_sep_tl:nV {reference} \l_qrbill_data_Reference_tl \par\vskip\baselineskip} } \exp_args:Nf \tl_if_empty:nF { @@ -455,6 +467,35 @@ } } +\cs_new:Nn \__qrbill_sep_tl:nn { +\int_compare:nTF {\int_use:c {g__qrbill_#1sep_int} = 0} { +#2 +}{ +\str_set:Nn \l_tmpa_str {#2} +\int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { +\tl_reverse:N \l_tmpa_str +} +\int_set:Nn \l_tmpb_int {\int_abs:n {\int_use:c {g__qrbill_#1sep_int}}} +\int_set:Nn \l_tmpa_int {1} +\tl_clear:N \l_tmpa_tl +\int_while_do:nn {\l_tmpa_int < \str_count:N \l_tmpa_str} { +\tl_put_right:Nx \l_tmpa_tl { +\str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\l_tmpa_int + \l_tmpb_int-1} +} +\int_add:Nn \l_tmpa_int {\l_tmpb_int} +\tl_put_right:Nn \l_tmpa_tl {{\tl_use:c {g__qrbill_#1sep_tl}}} +} +\tl_put_right:Nx \l_tmpa_tl { +\str_range:Nnn \l_tmpa_str {\l_tmpa_int} {\str_count:N \l_tmpa_str} +} +\int_compare:nT {\int_use:c {g__qrbill_#1sep_int} < 0} { +\tl_reverse:N \l_tmpa_tl +} +\l_tmpa_tl +} +} +\cs_generate_variant:Nn \__qrbill_sep_tl:nn {nV} + \newcommand*{\insertdebtor}{\null\qrbill_insert_address:N \g__qrbill_debtorprefix_tl} \newcommand*{\insertcreditor}{\null\qrbill_insert_address:N \g__qrbill_creditorprefix_tl} \newcommand*{\insertcurrency}{\l_qrbill_data_Currency_tl} |