Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Aug 22, 2024
1 parent 7bc0945 commit dd37879
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions latex/citation-style-language-cite.sty
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
\tl_if_blank:nTF {#3}
{ \__csl_print_undefined_citation:n {#3} }
{
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\prop_clear:N \l__csl_citation_properties_prop
\__csl_cite_init:
\__csl_collect_citation_items:nnn {#1} {#2} {#3}
\__csl_process_citation_info:
\prop_put:Nnn \l__csl_citation_properties_prop { noteIndex } { 0 }
Expand All @@ -101,9 +99,7 @@
\tl_if_blank:nTF {#3}
{ \__csl_print_undefined_citation:n {#3} }
{
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\prop_clear:N \l__csl_citation_properties_prop
\__csl_cite_init:
\__csl_collect_citation_items:nnn {#1} {#2} {#3}
\__csl_process_citation_info:
\tl_if_empty:nF {#4}
Expand All @@ -119,9 +115,7 @@
\tl_if_blank:nTF {#3}
{ \__csl_print_undefined_citation:n {#3} }
{
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\prop_clear:N \l__csl_citation_properties_prop
\__csl_cite_init:
\__csl_collect_citation_items:nnn {#1} {#2} {#3}
\__csl_process_citation_info:
\tl_if_empty:nF {#4}
Expand Down Expand Up @@ -162,9 +156,7 @@

\cs_new:Npn \__csl_cites:
{
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\prop_clear:N \l__csl_citation_properties_prop
\__csl_cite_init:
\bool_set_true:N \l__csl_multi_cite_bool
\__csl_next_cites:nnn
}
Expand Down Expand Up @@ -193,6 +185,18 @@
}


\cs_new:Npn \__csl_cite_init:
{
\bool_set_false:N \l__csl_multi_cite_bool
\prop_clear:N \l__csl_citation_info_prop
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\prop_clear:N \l__csl_citation_properties_prop
\tl_clear:N \l__csl_cite_prefix_tl
\tl_clear:N \l__csl_cite_suffix_tl
}


% Appends the cite key into \l__csl_cite_keys_seq and cite-items into
% \l__csl_citation_items_seq
% #1, #2: prenote/postnote
Expand Down Expand Up @@ -607,8 +611,7 @@

\cs_new:Npn \__csl_no_cite:n #1
{
\seq_clear:N \l__csl_cite_keys_seq
\seq_clear:N \l__csl_citation_items_seq
\__csl_cite_init:
\__csl_collect_citation_items:nnn { } { } {#1}
\tl_set:Nx \l__csl_cite_items_tl
{ \seq_use:Nn \l__csl_citation_items_seq { , } }
Expand Down

0 comments on commit dd37879

Please sign in to comment.