From e1449e04bf8c0fd9d480fd30a437b89aa11b023d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 28 Sep 2008 00:44:07 +0000 Subject: notes2bib 1.5b (24sep08) git-svn-id: svn://tug.org/texlive/trunk@10762 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/notes2bib/notes2bib.sty | 2 +- .../texmf-dist/tex/latex/notes2bib/xnotes2bib.sty | 494 ++++++++++----------- 2 files changed, 233 insertions(+), 263 deletions(-) (limited to 'Master/texmf-dist/tex/latex/notes2bib') diff --git a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty index 62a94d290cb..ba97c93410a 100644 --- a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty +++ b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty @@ -15,7 +15,7 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{notes2bib} - [2008/09/09 v1.5a Integrating notes into the bibliography] + [2008/09/24 v1.5b Integrating notes into the bibliography] \RequirePackage{xkeyval}[2005/05/07] \newcommand*{\niib@tempa}{} \newcommand*{\niib@tempb}{} diff --git a/Master/texmf-dist/tex/latex/notes2bib/xnotes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/xnotes2bib.sty index 78cb7a6f487..5e809c77561 100644 --- a/Master/texmf-dist/tex/latex/notes2bib/xnotes2bib.sty +++ b/Master/texmf-dist/tex/latex/notes2bib/xnotes2bib.sty @@ -14,122 +14,89 @@ %% See http://www.latex-project.org/lppl.txt %% --------------------------------------------------------------- %% -\NeedsTeXFormat{LaTeX2e} -\begingroup - \@ifundefined{eTeXversion}{% - \PackageError{xnotes2bib} - {Not running under e-TeX} - {This package requires e-TeX: enable the extensions!}% - \endgroup\endinput - }{% - \endgroup - } \RequirePackage{l3names} -\ProvidesExplPackage - {xnotes2bib}{2008/09/09}{0.0} +\GetIdInfo$Id: xnotes2bib.dtx 4 2008-09-23 09:00:00Z joseph $ {Integrating notes into the bibliography (expl3 version)} -\RequirePackage{expl3,xparse} -\DeclareOption*{ - \PackageWarning{xnotes2bib}{ - All~package~control~should~be~given~using~the\MessageBreak - \token_to_string:N\niibsetup\space macro - } +\ProvidesExplPackage + {\filename}{\filedate}{\fileversion}{\filedescription} +\RequirePackage {expl3,keys3,xparse} +\err_file_new:Nn \c_niib_err_tlp {xnotes2bib.err} +\tlp_new:Nn \l_niib_err_option_tlp {option} +\err_interrupt_new:NNNnnn \c_niib_err_tlp \l_niib_err_option_tlp 0 + {All~package~control~should~be~given~using~the~\token_to_str:N~ + \niibsetup~\text_put_sp:~macro} + {\err_help_return_or_X:} + {} +\err_file_close:N \c_niib_err_tlp +\DeclareOption* { + \err_interrupt:NNw \c_niib_err_tlp \l_niib_err_option_tlp } -\ProcessOptions\scan_stop: +\ProcessOptions \scan_stop: \int_new:N \g_niib_note_int \def_new:Npn \niib_thenote: { \l_niib_notename_tlp - \num_compare:nNnT {\g_niib_totalnotes_int} > {\c_nine}{ - \num_compare:nNnF {\g_niib_note_int} > {\c_nine}{ + \num_compare:nNnT {\g_niib_totalnotes_int} > {\c_nine} { + \num_compare:nNnF {\g_niib_note_int} > {\c_nine} { 0 } } \int_to_arabic:n \g_niib_note_int } -\RequirePackage{keyval} -\clist_new:N\g_niib_KV_bool_clist -\clist_put_left:Nn\g_niib_KV_bool_clist{true,false} -\def_new:Npn\niib_KV_bool:nT #1#2 { - \define@key{niib}{#1}[true]{ - \clist_if_in:cnTF{g_niib_KV_bool_clist}{##1}{ - #2 - }{ - \PackageError{xnotes2bib}{ - Unknown~choice~`##1' - }{ - The~Boolean~option~`#1'~accepts~only~the\MessageBreak - values~true~and~false - } +\bool_new:N \l_niib_after_cite_bool +\bool_new:N \l_niib_before_cite_bool +\let_new:NN \niib_convert_endnotes: \scan_stop: +\let_new:NN \niib_convert_footnotes: \scan_stop: +\keys_manage_quick:n { + niib/.cd:, + cite/.set:N = \niib_cite:n, + debug/.choice:, + debug/.default:n = true, + debug/true/.code:n = { + \def:Npn \niib_debug:n ##1 { + \err_info:nn {##1} {(xnotes2bib) \text_put_four_sp:} } - } + }, + debug/false/.code:n = { + \let:NN \niib_debug:n \use_none:n + }, + convert~endnotes/.choices:nn = {true,false} { + \let:Nc \niib_convert_endnotes: + {niib_convert_endnotes_ \l_keys_current_choice_tlp} + }, + convert~endnotes/.default:n = true, + convert~footnotes/.choices:nn = {true,false} { + \let:Nc \niib_convert_footnotes: + {niib_convert_footnotes_ \l_keys_current_choice_tlp} + }, + convert~footnotes/.default:n = true, + /keys/current~module:n = niib, + field/.set:c = field, + key~after/.set:c = key_after, + key~before/.set:c = key_before, + key~mixed/.set:c = key_mixed, + notename/.set:c = notename, + placement/.choice: = \l_niib_placement_tlp, + placement/.default:n = mixed, + placement/after/.code:n = { + \bool_set_true:N \l_niib_after_cite_bool + \bool_set_false:N \l_niib_before_cite_bool + }, + placement/before/.code:n = { + \bool_set_false:N \l_niib_after_cite_bool + \bool_set_true:N \l_niib_before_cite_bool + }, + placement/mixed/.code:n = { + \bool_set_false:N \l_niib_after_cite_bool + \bool_set_false:N \l_niib_before_cite_bool + }, + prefix/.set:c = prefix_tlp, + presort~after/.set:c = presort_after, + presort~before/.set:c = presort_before, + presort~mixed/.set:c = presort_mixed, + record/.set:c = record } -\def_new:Npn\niib_KV_choice:nnT #1#2#3 { - \cs_if_free:cTF{g_niib_KV_#1_clist}{ - \clist_new:c{g_niib_KV_#1_clist} - }{ - \clist_gclear:c{g_niib_KV_#1_clist} - } - \clist_put_left:cn{g_niib_KV_#1_clist}{#2} - \define@key{niib}{#1}{ - \clist_if_in:cnTF{g_niib_KV_#1_clist}{##1}{ - #3 - }{ - \PackageError{xnotes2bib}{ - Unknown~choice~`##1' - }{ - The~option~`#1'~accepts~only~the~values:\MessageBreak - #2 - } - } - } -} -\def_new:Npn\niib_KV_cs_n:n #1 { - \define@key{niib}{#1}{ - \def:cNn{niib_#1:n} 0 {##1} - } -} -\def_new:Npn\niib_KV_tlp:n #1 { - \tlp_new:c {l_niib_#1_tlp} - \define@key{niib}{#1}{ - \tlp_set:cn {l_niib_#1_tlp}{##1} - } -} -\niib_KV_cs_n:n{cite} -\niib_KV_tlp:n{field} -\niib_KV_tlp:n{key~after} -\niib_KV_tlp:n{key~before} -\niib_KV_tlp:n{key~mixed} -\niib_KV_tlp:n{notename} -\niib_KV_tlp:n{prefix} -\niib_KV_tlp:n{presort~after} -\niib_KV_tlp:n{presort~before} -\niib_KV_tlp:n{presort~mixed} -\niib_KV_tlp:n{record} -\let_new:NN\niib_convert_endnotes:\scan_stop: -\let_new:NN\niib_convert_footnotes:\scan_stop: -\niib_KV_bool:nT{convert~endnotes}{ - \let:Nc\niib_convert_endnotes:{niib_convert_endnotes_#1:} -} -\niib_KV_bool:nT{convert~footnotes}{ - \let:Nc\niib_convert_footnotes:{niib_convert_footnotes_#1:} -} -\niib_KV_bool:nT{debug}{ - \let:Nc\niib_debug:n{niib_debug_#1:n} -} -\def_new:Npn\niib_debug_true:n #1 { - \PackageInfo{xnotes2bib}{#1} -} -\let_new:NN\niib_debug_false:n\use_none:n -\bool_new:N\l_niib_after_cite_bool -\bool_new:N\l_niib_before_cite_bool -\niib_KV_choice:nnT{placement}{after,before,mixed}{ - \bool_set_false:N\l_niib_before_cite_bool - \bool_set_false:N\l_niib_after_cite_bool - \cs_if_really_exist:cT{l_niib_#1_cite_bool}{ - \bool_set_true:c{l_niib_#1_cite_bool} - } -} -\setkeys{niib}{ +\keys_manage_quick:n{ + /niib/.cd:, cite = \cite, debug = false, field = note, @@ -143,230 +110,235 @@ presort~before = ml, presort~mixed = mm, record = Misc} -\NewDocumentCommand{\bibnote}{o>{P}m}{ - \IfNoValueTF{#1}{ +\NewDocumentCommand {\bibnote} {o>{P}m} { + \IfNoValueTF {#1} { \int_gincr:N \g_niib_note_int - \bibnotetext{#2} - \bibnotemark[\niib_thenote:] + \bibnotetext {#2} + \bibnotemark [\niib_thenote:] }{ - \bibnotetext[#1]{#2} - \bibnotemark[#1] + \bibnotetext [#1] {#2} + \bibnotemark [#1] } } -\NewDocumentCommand{\bibnotemark}{o}{ - \IfNoValueTF{#1}{ +\NewDocumentCommand {\bibnotemark} {o} { + \IfNoValueTF {#1} { \int_gincr:N \g_niib_note_int - \niib_notemark:n{\niib_thenote:} + \niib_notemark:n {\niib_thenote:} }{ - \niib_notemark:n{#1} + \niib_notemark:n {#1} } } -\NewDocumentCommand{\bibnotetext}{O{\niib_thenote:}>{P}m}{ +\NewDocumentCommand {\bibnotetext} {O{\niib_thenote:}>{P}m} { \if@filesw \cs_if_free:NT \g_niib_out_stream { \iow_new:N \g_niib_out_stream \iow_open:Nn \g_niib_out_stream - {\l_niib_prefix_tlp\c_job_name_tlp.bib} + {\l_niib_prefix_tlp \c_job_name_tlp.bib} \iow_expanded:Nn \g_niib_out_stream - {This~is~an~auxiliary~file~used~by~the~`xnotes2bib'~ - package.^^J This~file~may~safely~be~deleted.^^J It~ - will~be~recreated~as~required.^^J} + {This~is~an~auxiliary~file~used~by~the~`xnotes2bib'~package.^^J + This~file~may~safely~be~deleted.^^J It~will~be~recreated~as~ + required.^^J} } - \niib_debug:n{ - Writing~text:\MessageBreak #2\MessageBreak to~database~ - for~note~`#1' + \niib_debug:n { + Writing~text:\MessageBreak #2\MessageBreak to~database~for~note~ + `#1' } \iow_expanded:Nn \g_niib_out_stream { @\l_niib_record_tlp{ #1,^^J - \space\space \l_niib_field_tlp\space + \text_put_sp: \text_put_sp: \l_niib_field_tlp \text_put_sp: =~{\exp_not:n{#2}},^^J - \space\space \l_niib_keyname_tlp\space + \text_put_sp: \text_put_sp: \l_niib_keyname_tlp \text_put_sp: =~{\niib_key:#1},^^J - \space\space presort~ + \text_put_sp: \text_put_sp: presort~ =~{\niib_presort:},^^J }^^J } \fi } -\NewDocumentCommand{\flushnotestack}{}{ - \clist_if_empty:NF\g_niib_before_cite_clist{ +\NewDocumentCommand {\flushnotestack} {} { + \clist_if_empty:NF \g_niib_before_cite_clist { \if@filesw - \iow_expanded:Nn\@auxout{ - \token_to_string:N\niibbeforecite{ + \iow_expanded:Nn \@auxout { + \token_to_str:N \niibbeforecite { \g_niib_before_cite_clist } } \fi } - \clist_if_empty:NF\g_niib_after_cite_clist{ - \nocite{\g_niib_after_cite_clist} + \clist_if_empty:NF \g_niib_after_cite_clist { + \nocite { \g_niib_after_cite_clist} \if@filesw - \iow_expanded:Nn\@auxout{ - \token_to_string:N\niibaftercite{\g_niib_after_cite_clist} + \iow_expanded:Nn \@auxout { + \token_to_str:N \niibaftercite {\g_niib_after_cite_clist} } \fi } - \clist_gclear:N\g_niib_after_cite_clist + \clist_gclear:N \g_niib_after_cite_clist } -\NewDocumentCommand{\niibsetup}{m}{\setkeys{niib}{#1}} -\clist_new:N\g_niib_before_cite_old_clist -\clist_new:N\g_niib_after_cite_old_clist -\tlp_new:N\g_niib_document_tlp -\tlp_put_right:Nn\document{\g_niib_document_tlp} -\NewDocumentCommand{\niibbeforecite}{m}{ - \clist_gput_right:Nn\g_niib_before_cite_old_clist{#1} - \tlp_gput_right:Nn\g_niib_document_tlp{\nocite{#1}} +\NewDocumentCommand {\niibsetup} {m} {\keys_manage:n {/niib/.cd:,#1}} +\clist_new:N \g_niib_before_cite_old_clist +\clist_new:N \g_niib_after_cite_old_clist +\tlp_new:N \g_niib_document_tlp +\tlp_gput_right:Nn \document {\g_niib_document_tlp} +\NewDocumentCommand {\niibbeforecite} {m} { + \clist_gput_right:Nn \g_niib_before_cite_old_clist {#1} + \tlp_gput_right:Nn \g_niib_document_tlp {\nocite{#1}} } -\NewDocumentCommand{\niibaftercite}{m}{ - \clist_gput_right:Nn\g_niib_after_cite_old_clist{#1} +\NewDocumentCommand {\niibaftercite} {m} { + \clist_gput_right:Nn \g_niib_after_cite_old_clist {#1} } \int_new:N \g_niib_totalnotes_int -\NewDocumentCommand{\niibtotalnotes}{m}{ +\NewDocumentCommand {\niibtotalnotes} {m} { \int_gset:Nn \g_niib_totalnotes_int {#1} } \def_new:Npn \niib_notemark:n #1 { - \niib_debug:n{Creating~citation~for~note~`#1'} - \bool_if:NT\l_niib_before_cite_bool{ - \niib_debug:n{Note~`#1'~before~real~citations} - \clist_gput_right:Nx\g_niib_before_cite_clist{#1} + \niib_debug:n {Creating~citation~for~note~`#1'} + \bool_if:NT \l_niib_before_cite_bool { + \niib_debug:n {Note~`#1'~before~real~citations} + \clist_gput_right:Nx \g_niib_before_cite_clist {#1} } - \bool_if:NTF\l_niib_after_cite_bool{ - \niib_debug:n{Note~`#1'~after~real~citations} - \clist_gput_right:Nx\g_niib_after_cite_clist{#1} - \niib_after_cite:n{#1} + \bool_if:NTF \l_niib_after_cite_bool { + \niib_debug:n {Note~`#1'~after~real~citations} + \clist_gput_right:Nx \g_niib_after_cite_clist {#1} + \niib_after_cite:n {#1} }{ - \niib_cite:n{#1} + \niib_cite:n {#1} } } -\clist_new:N\g_niib_before_cite_clist -\clist_new:N\g_niib_after_cite_clist -\def_new:Npn\niib_key: { - \bool_if:NTF\l_niib_before_cite_bool{ - \tlp_use:c{l_niib_key~before_tlp} +\clist_new:N \g_niib_before_cite_clist +\clist_new:N \g_niib_after_cite_clist +\def_new:Npn \niib_key: { + \bool_if:NTF \l_niib_before_cite_bool { + \tlp_use:N \l_niib_key_before_tlp }{ - \bool_if:NTF\l_niib_after_cite_bool{ - \tlp_use:c{l_niib_key~after_tlp} + \bool_if:NTF \l_niib_after_cite_bool { + \tlp_use:N \l_niib_key_after_tlp }{ - \tlp_use:c{l_niib_key~mixed_tlp} + \tlp_use:N \l_niib_key_mixed_tlp } } } -\def_new:Npn\niib_presort: { - \bool_if:NTF\l_niib_before_cite_bool{ - \tlp_use:c{l_niib_presort~before_tlp} +\def_new:Npn \niib_presort: { + \bool_if:NTF \l_niib_before_cite_bool { + \tlp_use:N \l_niib_presort~before_tlp }{ - \bool_if:NTF\l_niib_after_cite_bool{ - \tlp_use:c{l_niib_presort~after_tlp} + \bool_if:NTF \l_niib_after_cite_bool { + \tlp_use:N \l_niib_presort~after_tlp }{ - \tlp_use:c{l_niib_presort~mixed_tlp} + \tlp_use:N \l_niib_presort~mixed_tlp } } } -\def_new:Npn\niib_convert_endnotes_false: { - \niib_debug:n{Restoring~normal~endnotes} - \let:NN\endnote\niib_saved_endnote: - \let:NN\endnotemark\niib_saved_endnotemark: - \let:NN\endnotetext\niib_saved_endnotetext: +\def_new:Npn \niib_convert_endnotes_false: { + \niib_debug:n {Restoring~normal~endnotes} + \let:NN \endnote \niib_saved_endnote: + \let:NN \endnotemark \niib_saved_endnotemark: + \let:NN \endnotetext \niib_saved_endnotetext: } -\def_new:Npn\niib_convert_endnotes_true: { - \niib_debug:n{Converting~endnotes~to~bibnotes} - \let:NN\endnote\bibnote - \let:NN\endnotemark\bibnotemark - \let:NN\endnotetext\bibnotetext +\def_new:Npn \niib_convert_endnotes_true: { + \niib_debug:n {Converting~endnotes~to~bibnotes} + \let:NN \endnote \bibnote + \let:NN \endnotemark \bibnotemark + \let:NN \endnotetext \bibnotetext } -\def_new:Npn\niib_convert_footnotes_false: { - \niib_debug:n{Restoring~normal~footnotes} - \let:NN\footnote\niib_saved_footnote: - \let:NN\footnotemark\niib_saved_footnotemark: - \let:NN\footnotetext\niib_saved_footnotetext: +\def_new:Npn \niib_convert_footnotes_false: { + \niib_debug:n {Restoring~normal~footnotes} + \let:NN \footnote \niib_saved_footnote: + \let:NN \footnotemark \niib_saved_footnotemark: + \let:NN \footnotetext \niib_saved_footnotetext: } -\def_new:Npn\niib_convert_footnotes_true: { - \niib_debug:n{Converting~footnotes~to~bibnotes} - \let:NN\footnote\bibnote - \let:NN\footnotemark\bibnotemark - \let:NN\footnotetext\bibnotetext +\def_new:Npn \niib_convert_footnotes_true: { + \niib_debug:n {Converting~footnotes~to~bibnotes} + \let:NN \footnote \bibnote + \let:NN \footnotemark \bibnotemark + \let:NN \footnotetext \bibnotetext } -\def:Npn\thanks #1 { +\def:Npn \thanks #1 { \niib_saved_footnotemark: - \protected@xdef\@thanks{\@thanks - \protect\niib_saved_footnotetext:[\the\c@footnote]{#1}} + \protected@xdef \@thanks { + \@thanks + \protect \niib_saved_footnotetext: [\the\c@footnote] {#1} + } } \tlp_new:N \l_niib_keyname_tlp \AtBeginDocument{ - \PackageInfo{xnotes2bib}{ - Beginning~\token_to_string:N\AtBeginDocument\space tasks - } - \@ifpackageloaded{biblatex}{ + \err_info:nn { + (xnotes2bib) \text_put_sp: Beginning~\token_to_str:N + \AtBeginDocument \text_put_sp: tasks + } {} + \@ifpackageloaded {biblatex} { \tlp_set:Nn \l_niib_keyname_tlp {keysort} - \gappto\blx@bibfiles{,\niib_prefix\c_job_name_tlp} - \let_new:NN\printbibnotes\printbibliography - \def_new:Npn\niib_after_cite:n #1 { - \AtNextCite{\@fileswfalse} - \niib_cite:n{#1} + \gappto \blx@bibfiles {,\niib_prefix\c_job_name_tlp} + \let_new:NN \printbibnotes \printbibliography + \def_new:Npn \niib_after_cite:n #1 { + \AtNextCite {\@fileswfalse} + \niib_cite:n {#1} } }{ \tlp_gset:Nn \l_niib_keyname_tlp {key} - \let_new:NN\niib_biliography:n\bibliography - \def:Npn\bibliography #1 { - \int_compare:nNnTF{\g_niib_note_int}={\c_zero}{ - \niib_biliography:n{#1} + \let_new:NN \niib_biliography:n \bibliography + \def:Npn \bibliography #1 { + \int_compare:nNnTF {\g_niib_note_int} = {\c_zero} { + \niib_biliography:n {#1} }{ - \niib_biliography:n{ - #1,\l_niib_prefix_tlp\c_job_name_tlp + \niib_biliography:n { + #1, \l_niib_prefix_tlp \c_job_name_tlp } } } - \NewDocumentCommand{\printbibnotes}{}{ - \niib_biliography:n{\l_niib_prefix_tlp\c_job_name_tlp} + \NewDocumentCommand {\printbibnotes} {} { + \niib_biliography:n {\l_niib_prefix_tlp\c_job_name_tlp} } - \newif\ifniib@filesw - \@ifpackageloaded{cite}{ - \def_new:Npn\niib_after_cite:n #1 { + \newif \ifniib@filesw + \@ifpackageloaded {cite}{ + \def_new:Npn \niib_after_cite:n #1 { \let:NN \ifniib@filesw \if@filesw \@fileswfalse \def:Npn \niib_auxhandle: { \let:NN \if@filesw \ifniib@filesw \let:NN \niib_auxhandle: \scan_stop: } - \niib_cite:n{#1} + \niib_cite:n {#1} } \tlp_gput_right:Nn \g_niib_document_tlp { - \cs_if_exist:NTF\@restore@auxhandle{ - \tlp_put_right:Nn\@restore@auxhandle{\niib_auxhandle:} + \cs_if_exist:NTF \@restore@auxhandle{ + \tlp_put_right:Nn \@restore@auxhandle {\niib_auxhandle:} }{ - \def_new:Npn\@restore@auxhandle {\niib_auxhandle:} + \def_new:Npn \@restore@auxhandle {\niib_auxhandle:} } } - \let_new:NN\niib_auxhandle:\scan_stop: + \let_new:NN \niib_auxhandle: \scan_stop: }{ - \def_new:Npn\niib_after_cite:n #1 { - \let\ifniib@filesw\if@filesw + \def_new:Npn \niib_after_cite:n #1 { + \let:NN \ifniib@filesw \if@filesw \@fileswfalse - \niib_cite:n{#1} - \let\if@filesw\ifniib@filesw + \niib_cite:n {#1} + \let:NN \if@filesw \ifniib@filesw } } } - \let_new:NN\niib_saved_footnote:\footnote - \let_new:NN\niib_saved_footnotemark:\footnotemark - \let_new:NN\niib_saved_footnotetext:\footnotetext - \let_new:NN\niib_saved_endnote:\endnote - \let_new:NN\niib_saved_endnotemark:\endnotemark - \let_new:NN\niib_saved_endnotetext:\endnotetext + \let_new:NN \niib_saved_footnote: \footnote + \let_new:NN \niib_saved_footnotemark: \footnotemark + \let_new:NN \niib_saved_footnotetext: \footnotetext + \let_new:NN \niib_saved_endnote: \endnote + \let_new:NN \niib_saved_endnotemark: \endnotemark + \let_new:NN \niib_saved_endnotetext: \endnotetext \niib_convert_endnotes: \niib_convert_footnotes: - \niib_KV_bool:nT{convert~endnotes}{ - \use:c{niib_convert_endnotes_#1:} - } - \niib_KV_bool:nT{convert~footnotes}{ - \use:c{niib_convert_footnotes_#1:} - } - \PackageInfo{xnotes2bib}{ - Finished~\token_to_string:N\AtBeginDocument\space tasks + \keys_manage_quick:n { + /niib/.cd:, + convert~endnotes/true/.code:n = {\niib_convert_endnotes_true:}, + convert~endnotes/false/.code:n = {\niib_convert_endnotes_false:}, + convert~footnotes/true/.code:n = {\niib_convert_footnotes_true:}, + convert~footnotes/false/.code:n = {\niib_convert_footnotes_false:}, } + \err_info:nn { + (xnotes2bib) \text_put_sp: Finished~\token_to_str:N + \AtBeginDocument \text_put_sp: tasks + } {} } -\def_new:Npn\niib_rerun_check:n #1 { +\def_new:Npn \niib_rerun_check:n #1 { \clist_if_empty:cTF {g_niib_old#1cite_clist}{ \clist_if_empty:cF {g_niib_#1cite_clist}{ \niib_rerun_log: @@ -375,58 +347,56 @@ \clist_if_empty:cTF {g_niib_#1cite_clist}{ \niib_rerun_log: }{ - \bool_set_false:N\l_tmpa_bool - \def:Npn\niib_rerun_test:n ##1 { - \clist_if_in:cnTF{g_niib_old#1cite_clist}{##1}{ - \bool_set_true:N\l_tmpa_bool + \bool_set_false:N \l_tmpa_bool + \def:Npn \niib_rerun_test:n ##1 { + \clist_if_in:cnTF {g_niib_old#1cite_clist} {##1} { + \bool_set_true:N \l_tmpa_bool \clist_map_break:w }{ } } - \clist_map_function:cN{g_niib_#1cite_clist} + \clist_map_function:cN {g_niib_#1cite_clist} \niib_rerun_test:n - \def:Npn\niib_rerun_test:n ##1 { - \clist_if_in:cnTF{g_niib_#1cite_clist}{##1}{ - \bool_set_true:N\l_tmpa_bool + \def:Npn \niib_rerun_test:n ##1 { + \clist_if_in:cnTF {g_niib_#1cite_clist} {##1} { + \bool_set_true:N \l_tmpa_bool \clist_map_break:w }{ } } - \clist_map_function:cN{g_niib_old#1cite_clist} + \clist_map_function:cN {g_niib_old#1cite_clist} \niib_rerun_test:n - \bool_if:NF\l_tmpa_bool{ + \bool_if:NF \l_tmpa_bool { \niib_rerun_log: } } } } \let_new:NN \niib_rerun_test:n \use_none_i:n -\def_new:Npn\niib_rerun_log: { - \PackageInfo{xnotes2bib}{ - To~get~notes~in~the~correct~order,~please\MessageBreak - rerun~LaTeX,~(re)run~BibTeX~on~the~file~\c_job_name_tlp.aux - \MessageBreak and~rerun~LaTeX~again~afterwards - } +\def_new:Npn \niib_rerun_log: { + \err_info:nn { + (xnotes2bib) \text_put_sp: To~get~notes~in~the~correct~order,~ + please \err_newline: rerun~LaTeX,~(re)run~BibTeX~on~the~file~ + \c_job_name_tlp.aux \err_newline: and~rerun~LaTeX~again~afterwards + } {(xnotes2bib) \text_put_sp:} \io_put_log:x { - REQ:3:latex:REQ\iow_newline: - REQ:2:bibtex:REQ\iow_newline: - REQ:1:latex:REQ\iow_newline: + REQ:3:latex:REQ \iow_newline: + REQ:2:bibtex:REQ \iow_newline: + REQ:1:latex:REQ \iow_newline: } - \let\niib_rerun_log:\scan_stop: + \let \niib_rerun_log: \scan_stop: } \AtEndDocument{ - \niib_rerun_check:n{before} - \niib_rerun_check:n{after} + \niib_rerun_check:n {before} + \niib_rerun_check:n {after} \flushnotestack - \iow_expanded:Nn\@auxout{ - \token_to_string:N\niibtotalnotes{ - \int_to_arabic:n \g_niib_note_int - } + \iow_expanded:Nn \@auxout { + \token_to_str:N \niibtotalnotes {\int_to_arabic:n \g_niib_note_int} } - \num_compare:nNnF{\g_niib_totalnotes_int}={\g_niib_note_int}{ + \num_compare:nNnF {\g_niib_totalnotes_int} = {\g_niib_note_int} { \niib_rerun_log: } - \cs_if_free:NF \g_niib_out_stream{ + \cs_if_free:NF \g_niib_out_stream { \iow_close:N \g_niib_out_stream } } -- cgit v1.2.3