From de79a26f78ad26d980ffb52a97e0b5c12e386dce Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 7 Nov 2012 23:26:11 +0000 Subject: notes2bib (7nov12) git-svn-id: svn://tug.org/texlive/trunk@28205 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/latex/notes2bib/notes2bib.pdf | Bin 197895 -> 197849 bytes .../source/latex/notes2bib/notes2bib.dtx | 5 +- .../source/latex/notes2bib/notes2bib.ins | 75 ++++ .../texmf-dist/tex/latex/notes2bib/notes2bib.sty | 384 ++++++++++----------- 4 files changed, 270 insertions(+), 194 deletions(-) create mode 100644 Master/texmf-dist/source/latex/notes2bib/notes2bib.ins diff --git a/Master/texmf-dist/doc/latex/notes2bib/notes2bib.pdf b/Master/texmf-dist/doc/latex/notes2bib/notes2bib.pdf index 81dcacb18de..3290813d905 100644 Binary files a/Master/texmf-dist/doc/latex/notes2bib/notes2bib.pdf and b/Master/texmf-dist/doc/latex/notes2bib/notes2bib.pdf differ diff --git a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx index 8a2bb67cd65..0857e41482a 100644 --- a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx +++ b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx @@ -620,19 +620,20 @@ This work consists of the file notes2bib.dtx % variables} %\changes{v2.0g}{2011/06/30}{Switch from \cs{intexpr_\ldots} to % \cs{int_\ldots} functions} +%\changes{v2.0j}{2012/11/07}{Change internal prefix} % % \begin{macrocode} %<*package> % \end{macrocode} % % \begin{macrocode} -%<@@=niib> +%<@@=notestobib> % \end{macrocode} % % Version data to start with. % \begin{macrocode} \ProvidesExplPackage - {notes2bib} {2012/07/16} {2.0i} + {notes2bib} {2012/11/07} {2.0j} {Integrating notes into the bibliography} \RequirePackage{l3keys2e} % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/notes2bib/notes2bib.ins b/Master/texmf-dist/source/latex/notes2bib/notes2bib.ins new file mode 100644 index 00000000000..0d5c6e535e3 --- /dev/null +++ b/Master/texmf-dist/source/latex/notes2bib/notes2bib.ins @@ -0,0 +1,75 @@ +%% +%% This is file `notes2bib.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% notes2bib.dtx (with options: `install') +%% --------------------------------------------------------------- +%% notes2bib --- Integrating notes into the bibliography +%% Maintained by Joseph Wright +%% E-mail: joseph.wright@morningstar2.co.uk +%% Released under the LaTeX Project Public License v1.3c or later +%% See http://www.latex-project.org/lppl.txt +%% --------------------------------------------------------------- +%% +\input l3docstrip.tex +\keepsilent +\askforoverwritefalse +\preamble +--------------------------------------------------------------- +notes2bib --- Integrating notes into the bibliography +Maintained by Joseph Wright +E-mail: joseph.wright@morningstar2.co.uk +Released under the LaTeX Project Public License v1.3c or later +See http://www.latex-project.org/lppl.txt +--------------------------------------------------------------- + +\endpreamble +\postamble + +Copyright (C) 2007-2011 by + Joseph Wright + +It may be distributed and/or modified under the conditions of +the LaTeX Project Public License (LPPL), either version 1.3c of +this license or (at your option) any later version. The latest +version of this license is in the file: + + http://www.latex-project.org/lppl.txt + +This work is "maintained" (as per LPPL maintenance status) by + Joseph Wright. + +This work consists of the file notes2bib.dtx + and the derived files notes2bib.ins, + notes2bib.pdf and + notes2bib.sty. + +\endpostamble +\usedir{tex/latex/notes2bib} +\generate{ + \file{\jobname.sty}{\from{\jobname.dtx}{package}} +} +\endbatchfile +%% +%% Copyright (C) 2007-2011 by +%% Joseph Wright +%% +%% It may be distributed and/or modified under the conditions of +%% the LaTeX Project Public License (LPPL), either version 1.3c of +%% this license or (at your option) any later version. The latest +%% version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Joseph Wright. +%% +%% This work consists of the file notes2bib.dtx +%% and the derived files notes2bib.ins, +%% notes2bib.pdf and +%% notes2bib.sty. +%% +%% +%% End of file `notes2bib.ins'. diff --git a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty index 2e27635d25b..e3674e8b038 100644 --- a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty +++ b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty @@ -15,11 +15,11 @@ %% \RequirePackage{xparse} \ProvidesExplPackage - {notes2bib} {2012/07/16} {2.0i} + {notes2bib} {2012/11/07} {2.0j} {Integrating notes into the bibliography} \RequirePackage{l3keys2e} -\tl_new:N \c__niib_file_message_tl -\tl_set:Nn \c__niib_file_message_tl { +\tl_new:N \c__notestobib_file_message_tl +\tl_set:Nn \c__notestobib_file_message_tl { \iow_char:N \% ~ This~is~an~auxiliary~file~used~by~the~'notes2bib'~package. \iow_newline: @@ -30,73 +30,73 @@ It~will~be~recreated~as~required. \iow_newline: } -\clist_new:N \g__niib_after_clist -\clist_new:N \g__niib_before_clist -\clist_new:N \g__niib_all_after_clist -\clist_new:N \g__niib_all_before_clist -\int_new:N \g__niib_note_int -\tl_new:N \l__niib_presort_tl -\tl_new:N \l__niib_sortkey_tl -\clist_new:N \g__niib_previous_after_clist -\clist_new:N \g__niib_previous_before_clist -\int_new:N \g__niib_previous_notes_int -\tl_new:N \g__niib_notes_tl -\tl_new:N \l__niib_sortkey_field_tl -\int_new:N \g__niib_total_notes_int -\cs_new_nopar:Npn \__niib_cite:w { } +\clist_new:N \g__notestobib_after_clist +\clist_new:N \g__notestobib_before_clist +\clist_new:N \g__notestobib_all_after_clist +\clist_new:N \g__notestobib_all_before_clist +\int_new:N \g__notestobib_note_int +\tl_new:N \l__notestobib_presort_tl +\tl_new:N \l__notestobib_sortkey_tl +\clist_new:N \g__notestobib_previous_after_clist +\clist_new:N \g__notestobib_previous_before_clist +\int_new:N \g__notestobib_previous_notes_int +\tl_new:N \g__notestobib_notes_tl +\tl_new:N \l__notestobib_sortkey_field_tl +\int_new:N \g__notestobib_total_notes_int +\cs_new_nopar:Npn \__notestobib_cite:w { } \keys_define:nn { notes2bib } { cite-function .code:n = - { \AtBeginDocument { \cs_set_eq:NN \__niib_cite:w #1 } } , - file-name .tl_gset_x:N = \g__niib_filename_tl , + { \AtBeginDocument { \cs_set_eq:NN \__notestobib_cite:w #1 } } , + file-name .tl_gset_x:N = \g__notestobib_filename_tl , convert-endnotes .choice: , convert-endnotes / false .code:n = - { \AtBeginDocument { \__niib_from_bibnote:n { endnote } } } , + { \AtBeginDocument { \__notestobib_from_bibnote:n { endnote } } } , convert-endnotes / true .code:n = - { \AtBeginDocument { \__niib_to_bibnote:n { endnote } } } , + { \AtBeginDocument { \__notestobib_to_bibnote:n { endnote } } } , convert-footnotes .choice: , convert-footnotes / false .code:n = - { \AtBeginDocument { \__niib_from_bibnote:n { footnote } } } , + { \AtBeginDocument { \__notestobib_from_bibnote:n { footnote } } } , convert-footnotes / true .code:n = - { \AtBeginDocument { \__niib_to_bibnote:n { footnote } } } , - keyword-entry .tl_set:N = \l__niib_keyword_tl , - note-field .tl_set:N = \l__niib_note_field_tl , - note-name .tl_set:N = \l__niib_note_name_tl , + { \AtBeginDocument { \__notestobib_to_bibnote:n { footnote } } } , + keyword-entry .tl_set:N = \l__notestobib_keyword_tl , + note-field .tl_set:N = \l__notestobib_note_field_tl , + note-name .tl_set:N = \l__notestobib_note_name_tl , placement .choice: , placement / after .code:n = { - \cs_set_eq:NN \__niib_mark_note:n \__niib_mark_note_after:n - \tl_set_eq:NN \l__niib_presort_tl \l__niib_presort_after_tl - \tl_set_eq:NN \l__niib_sortkey_tl \l__niib_sortkey_after_tl + \cs_set_eq:NN \__notestobib_mark_note:n \__notestobib_mark_note_after:n + \tl_set_eq:NN \l__notestobib_presort_tl \l__notestobib_presort_after_tl + \tl_set_eq:NN \l__notestobib_sortkey_tl \l__notestobib_sortkey_after_tl }, placement / before .code:n = { - \cs_set_eq:NN \__niib_mark_note:n \__niib_mark_note_before:n - \tl_set_eq:NN \l__niib_presort_tl \l__niib_presort_before_tl - \tl_set_eq:NN \l__niib_sortkey_tl \l__niib_sortkey_before_tl + \cs_set_eq:NN \__notestobib_mark_note:n \__notestobib_mark_note_before:n + \tl_set_eq:NN \l__notestobib_presort_tl \l__notestobib_presort_before_tl + \tl_set_eq:NN \l__notestobib_sortkey_tl \l__notestobib_sortkey_before_tl }, placement / mixed .code:n = { - \cs_set_eq:NN \__niib_mark_note:n \__niib_mark_note_mixed:n - \tl_set_eq:NN \l__niib_presort_tl \l__niib_presort_mixed_tl - \tl_set_eq:NN \l__niib_sortkey_tl \l__niib_sortkey_mixed_tl + \cs_set_eq:NN \__notestobib_mark_note:n \__notestobib_mark_note_mixed:n + \tl_set_eq:NN \l__notestobib_presort_tl \l__notestobib_presort_mixed_tl + \tl_set_eq:NN \l__notestobib_sortkey_tl \l__notestobib_sortkey_mixed_tl }, - presort-after .tl_set:N = \l__niib_presort_after_tl , - presort-before .tl_set:N = \l__niib_presort_before_tl , - presort-mixed .tl_set:N = \l__niib_presort_mixed_tl , - record-type .tl_set:N = \l__niib_record_type_tl , - refsection-name .tl_set:N = \l__niib_refsection_name_tl , - refsection-separator .tl_set:N = \l__niib_refsection_sep_tl , - sort-key-after .tl_set:N = \l__niib_sortkey_before_tl , - sort-key-before .tl_set:N = \l__niib_sortkey_after_tl , - sort-key-mixed .tl_set:N = \l__niib_sortkey_mixed_tl , - use-sort-key .bool_set:N = \l__niib_write_sortkey_bool , + presort-after .tl_set:N = \l__notestobib_presort_after_tl , + presort-before .tl_set:N = \l__notestobib_presort_before_tl , + presort-mixed .tl_set:N = \l__notestobib_presort_mixed_tl , + record-type .tl_set:N = \l__notestobib_record_type_tl , + refsection-name .tl_set:N = \l__notestobib_refsection_name_tl , + refsection-separator .tl_set:N = \l__notestobib_refsection_sep_tl , + sort-key-after .tl_set:N = \l__notestobib_sortkey_before_tl , + sort-key-before .tl_set:N = \l__notestobib_sortkey_after_tl , + sort-key-mixed .tl_set:N = \l__notestobib_sortkey_mixed_tl , + use-sort-key .bool_set:N = \l__notestobib_write_sortkey_bool , } \keys_set:nn { notes2bib } { cite-function = \cite , @@ -137,32 +137,32 @@ \keys_define:nn { notes2bib } { cite-function .code:n = - { \cs_set_eq:NN \__niib_cite:w #1 } , + { \cs_set_eq:NN \__notestobib_cite:w #1 } , file-name .code:n = { \msg_info:nnn { notes2bib } { preamble-only } { file-name } }, convert-endnotes / false .code:n = - { \__niib_from_bibnote:n { endnote } } , + { \__notestobib_from_bibnote:n { endnote } } , convert-endnotes / true .code:n = - { \__niib_to_bibnote:n { endnote } } , + { \__notestobib_to_bibnote:n { endnote } } , convert-footnotes / false .code:n = - { \__niib_from_bibnote:n { footnote } } , + { \__notestobib_from_bibnote:n { footnote } } , convert-footnotes / true .code:n = - { \__niib_to_bibnote:n { footnote } } , + { \__notestobib_to_bibnote:n { footnote } } , } } \msg_new:nnn { notes2bib } { preamble-only } { The~option~'#1'~can~only~be~used~in~the~preamble. } -\cs_new_nopar:Npn \__niib_insert_refsection: { } +\cs_new_nopar:Npn \__notestobib_insert_refsection: { } \AtBeginDocument { \@ifpackageloaded { biblatex } { - \cs_set_nopar:Npn \__niib_insert_refsection: + \cs_set_nopar:Npn \__notestobib_insert_refsection: { \int_compare:nNnT { \value { refsection } } > { 0 } { - \tl_use:N \l__niib_refsection_name_tl + \tl_use:N \l__notestobib_refsection_name_tl \arabic { refsection } - \tl_use:N \l__niib_refsection_sep_tl + \tl_use:N \l__notestobib_refsection_sep_tl } } } @@ -194,123 +194,123 @@ tail .meta:n = { placement = after } , writekey .meta:n = { use-sort-key = #1 } } -\cs_new_nopar:Npn \__niib_note_name: { - \__niib_insert_refsection: - \tl_use:N \l__niib_note_name_tl - \int_compare:nNnT \g__niib_previous_notes_int > \c_nine - { \int_compare:nNnT \g__niib_note_int < \c_ten { 0 } } - \int_to_arabic:n { \g__niib_note_int } -} -\cs_new_nopar:Npn \__niib_filesw: { } -\cs_new:Npn \__niib_mark_note:n #1 { } -\cs_generate_variant:Nn \__niib_mark_note:n { x } -\cs_new_protected:Npn \__niib_mark_note_after:n #1 { - \int_gincr:N \g__niib_total_notes_int - \clist_gput_right:Nx \g__niib_after_clist {#1} - \__niib_mark_note_after_aux:n {#1} -} -\cs_new:Npn \__niib_mark_note_after_aux:n #1 { } -\cs_new_protected:Npn \__niib_mark_note_before:n #1 { - \int_gincr:N \g__niib_total_notes_int - \clist_gput_right:Nx \g__niib_before_clist {#1} - \__niib_cite:w {#1} -} -\cs_new_protected:Npn \__niib_mark_note_mixed:n #1 { - \int_gincr:N \g__niib_total_notes_int - \__niib_cite:w {#1} -} -\cs_new:Npn \__niib_write_field:nn #1#2 { +\cs_new_nopar:Npn \__notestobib_note_name: { + \__notestobib_insert_refsection: + \tl_use:N \l__notestobib_note_name_tl + \int_compare:nNnT \g__notestobib_previous_notes_int > \c_nine + { \int_compare:nNnT \g__notestobib_note_int < \c_ten { 0 } } + \int_to_arabic:n { \g__notestobib_note_int } +} +\cs_new_nopar:Npn \__notestobib_filesw: { } +\cs_new:Npn \__notestobib_mark_note:n #1 { } +\cs_generate_variant:Nn \__notestobib_mark_note:n { x } +\cs_new_protected:Npn \__notestobib_mark_note_after:n #1 { + \int_gincr:N \g__notestobib_total_notes_int + \clist_gput_right:Nx \g__notestobib_after_clist {#1} + \__notestobib_mark_note_after_aux:n {#1} +} +\cs_new:Npn \__notestobib_mark_note_after_aux:n #1 { } +\cs_new_protected:Npn \__notestobib_mark_note_before:n #1 { + \int_gincr:N \g__notestobib_total_notes_int + \clist_gput_right:Nx \g__notestobib_before_clist {#1} + \__notestobib_cite:w {#1} +} +\cs_new_protected:Npn \__notestobib_mark_note_mixed:n #1 { + \int_gincr:N \g__notestobib_total_notes_int + \__notestobib_cite:w {#1} +} +\cs_new:Npn \__notestobib_write_field:nn #1#2 { \c_space_tl \c_space_tl #1 \c_space_tl = \c_space_tl {#2} , \iow_newline: } -\cs_generate_variant:Nn \__niib_write_field:nn { V } -\cs_new_protected_nopar:Npn \__niib_write_note:nn { +\cs_generate_variant:Nn \__notestobib_write_field:nn { V } +\cs_new_protected_nopar:Npn \__notestobib_write_note:nn { \if@filesw - \exp_after:wN \__niib_write_note_aux:nn + \exp_after:wN \__notestobib_write_note_aux:nn \else: \exp_after:wN \use_none:nn \fi: } -\cs_new_protected:Npn \__niib_write_note_aux:nn #1#2 { - \tl_gput_right:Nx \g__niib_notes_tl +\cs_new_protected:Npn \__notestobib_write_note_aux:nn #1#2 { + \tl_gput_right:Nx \g__notestobib_notes_tl { - @ \l__niib_record_type_tl + @ \l__notestobib_record_type_tl { #1 , \iow_newline: - \__niib_write_field:Vn \l__niib_note_field_tl { \exp_not:n {#2} } - \bool_if:NT \l__niib_write_sortkey_bool + \__notestobib_write_field:Vn \l__notestobib_note_field_tl { \exp_not:n {#2} } + \bool_if:NT \l__notestobib_write_sortkey_bool { - \__niib_write_field:Vn \l__niib_sortkey_field_tl - { \l__niib_sortkey_tl #1 } + \__notestobib_write_field:Vn \l__notestobib_sortkey_field_tl + { \l__notestobib_sortkey_tl #1 } } - \__niib_write_field:nn { keywords } { \l__niib_keyword_tl } - \__niib_write_field:nn { presort } { \l__niib_presort_tl } + \__notestobib_write_field:nn { keywords } { \l__notestobib_keyword_tl } + \__notestobib_write_field:nn { presort } { \l__notestobib_presort_tl } } \iow_newline: \iow_newline: } } -\cs_generate_variant:Nn \__niib_write_note:nn { x } -\cs_new_protected_nopar:Npn \__niib_record_notes: { +\cs_generate_variant:Nn \__notestobib_write_note:nn { x } +\cs_new_protected_nopar:Npn \__notestobib_record_notes: { \if@filesw - \exp_after:wN \__niib_flush_notes_aux: + \exp_after:wN \__notestobib_flush_notes_aux: \fi } -\cs_new_protected_nopar:Npn \__niib_flush_notes_aux: { - \clist_if_empty:NF \g__niib_before_clist +\cs_new_protected_nopar:Npn \__notestobib_flush_notes_aux: { + \clist_if_empty:NF \g__notestobib_before_clist { \iow_now:Nx \@auxout - { \NotesBeforeCitations { \exp_not:V \g__niib_before_clist } } - \clist_gput_right:NV \g__niib_all_before_clist \g__niib_before_clist - \clist_gclear:N \g__niib_before_clist + { \NotesBeforeCitations { \exp_not:V \g__notestobib_before_clist } } + \clist_gput_right:NV \g__notestobib_all_before_clist \g__notestobib_before_clist + \clist_gclear:N \g__notestobib_before_clist } - \clist_if_empty:NF \g__niib_after_clist + \clist_if_empty:NF \g__notestobib_after_clist { \iow_now:Nx \@auxout - { \NotesAfterCitations { \exp_not:V \g__niib_after_clist } } - \exp_args:NV \nocite \g__niib_after_clist - \clist_gput_right:NV \g__niib_all_after_clist \g__niib_after_clist - \clist_gclear:N \g__niib_after_clist + { \NotesAfterCitations { \exp_not:V \g__notestobib_after_clist } } + \exp_args:NV \nocite \g__notestobib_after_clist + \clist_gput_right:NV \g__notestobib_all_after_clist \g__notestobib_after_clist + \clist_gclear:N \g__notestobib_after_clist } } -\cs_new_protected_nopar:Npn \__niib_to_bibnote:n #1 { +\cs_new_protected_nopar:Npn \__notestobib_to_bibnote:n #1 { \cs_set_eq:cN {#1} \bibnote \cs_set_eq:cN { #1 mark } \bibnotemark \cs_set_eq:cN { #1 text } \bibnotetext } -\cs_new_protected_nopar:Npn \__niib_from_bibnote:n #1 { - \cs_set_eq:cc {#1} { __niib_ #1 :w } - \cs_set_eq:cc { #1 mark } { __niib_ #1 mark:w } - \cs_set_eq:cc { #1 text } { __niib_ #1 text:w } +\cs_new_protected_nopar:Npn \__notestobib_from_bibnote:n #1 { + \cs_set_eq:cc {#1} { __notestobib_ #1 :w } + \cs_set_eq:cc { #1 mark } { __notestobib_ #1 mark:w } + \cs_set_eq:cc { #1 text } { __notestobib_ #1 text:w } } \AtBeginDocument { - \cs_set_eq:NN \__niib_endnote:w \endnote - \cs_set_eq:NN \__niib_endnotemark:w \endnotemark - \cs_set_eq:NN \__niib_endnotetext:w \endnotetext - \cs_set_eq:NN \__niib_footnote:w \footnote - \cs_set_eq:NN \__niib_footnotemark:w \footnotemark - \cs_set_eq:NN \__niib_footnotetext:w \footnotetext + \cs_set_eq:NN \__notestobib_endnote:w \endnote + \cs_set_eq:NN \__notestobib_endnotemark:w \endnotemark + \cs_set_eq:NN \__notestobib_endnotetext:w \endnotetext + \cs_set_eq:NN \__notestobib_footnote:w \footnote + \cs_set_eq:NN \__notestobib_footnotemark:w \footnotemark + \cs_set_eq:NN \__notestobib_footnotetext:w \footnotetext } \AtBeginDocument { \@ifpackageloaded { biblatex } { - \cs_new_protected_nopar:Npn \__niib_print_notes: + \cs_new_protected_nopar:Npn \__notestobib_print_notes: { - \cs_set_nopar:Npx \__niib_create_print_notes: + \cs_set_nopar:Npx \__notestobib_create_print_notes: { \printbibliography - [ keyword = \exp_not:V \l__niib_keyword_tl ] + [ keyword = \exp_not:V \l__notestobib_keyword_tl ] } - \__niib_create_print_notes: + \__notestobib_create_print_notes: } } { - \cs_new_protected_nopar:Npn \__niib_print_notes: - { \exp_args:NV \__niib_bibliography:n \g__niib_filename_tl } + \cs_new_protected_nopar:Npn \__notestobib_print_notes: + { \exp_args:NV \__notestobib_bibliography:n \g__notestobib_filename_tl } } } -\cs_new_nopar:Npn \__niib_create_print_notes: { } -\cs_new_nopar:Npn \__niib_attach_bibliography: { +\cs_new_nopar:Npn \__notestobib_create_print_notes: { } +\cs_new_nopar:Npn \__notestobib_attach_bibliography: { \@ifpackageloaded { biblatex } { \@ifpackagelater { biblatex } { 2011/01/08 } @@ -319,27 +319,27 @@ { \exp_args:No \addglobalbib - { \g__niib_filename_tl .bib } + { \g__notestobib_filename_tl .bib } } - { \exp_args:NNV \bibliography * \g__niib_filename_tl } + { \exp_args:NNV \bibliography * \g__notestobib_filename_tl } } - { \exp_args:NV \bibliography \g__niib_filename_tl } + { \exp_args:NV \bibliography \g__notestobib_filename_tl } } { - \cs_new_eq:NN \__niib_bibliography:n \bibliography + \cs_new_eq:NN \__notestobib_bibliography:n \bibliography \RenewDocumentCommand \bibliography { m } { - \int_compare:nNnTF \g__niib_total_notes_int = \c_zero - { \__niib_bibliography:n {##1} } + \int_compare:nNnTF \g__notestobib_total_notes_int = \c_zero + { \__notestobib_bibliography:n {##1} } { - \cs_set_nopar:Npx \__niib_attach_bibliography: + \cs_set_nopar:Npx \__notestobib_attach_bibliography: { - \exp_not:N \__niib_bibliography:n + \exp_not:N \__notestobib_bibliography:n { - \exp_not:n {##1} , \exp_not:V \g__niib_filename_tl + \exp_not:n {##1} , \exp_not:V \g__notestobib_filename_tl } } - \__niib_attach_bibliography: + \__notestobib_attach_bibliography: } } } @@ -352,57 +352,57 @@ { \exp_args:No \addglobalbib - { \g__niib_filename_tl .bib } + { \g__notestobib_filename_tl .bib } } - { \exp_args:NNV \bibliography * \g__niib_filename_tl } + { \exp_args:NNV \bibliography * \g__notestobib_filename_tl } } - { \exp_args:NV \bibliography \g__niib_filename_tl } + { \exp_args:NV \bibliography \g__notestobib_filename_tl } } - { \AtBeginDocument { \__niib_attach_bibliography: } } + { \AtBeginDocument { \__notestobib_attach_bibliography: } } \AtBeginDocument { \@ifpackageloaded { biblatex } - { \tl_set:Nn \l__niib_sortkey_field_tl { sortkey } } - { \tl_set:Nn \l__niib_sortkey_field_tl { key } } + { \tl_set:Nn \l__notestobib_sortkey_field_tl { sortkey } } + { \tl_set:Nn \l__notestobib_sortkey_field_tl { key } } } \AtBeginDocument { \@ifpackageloaded { biblatex } { - \cs_set:Npn \__niib_mark_note_after_aux:n #1 + \cs_set:Npn \__notestobib_mark_note_after_aux:n #1 { \AtNextCite { \@fileswfalse } - \__niib_cite:w {#1} + \__notestobib_cite:w {#1} } } { - \cs_set:Npn \__niib_mark_note_after_aux:n #1 + \cs_set:Npn \__notestobib_mark_note_after_aux:n #1 { - \cs_set_eq:NN \__niib_filesw: \if@filesw + \cs_set_eq:NN \__notestobib_filesw: \if@filesw \@fileswfalse - \__niib_cite:w {#1} - \cs_set_eq:NN \if@filesw \__niib_filesw: + \__notestobib_cite:w {#1} + \cs_set_eq:NN \if@filesw \__notestobib_filesw: } } } \AtBeginDocument { \@ifpackageloaded { cite } { - \cs_set:Npn \__niib_mark_note_after_aux:n #1 + \cs_set:Npn \__notestobib_mark_note_after_aux:n #1 { - \cs_set_eq:NN \__niib_filesw: \if@filesw + \cs_set_eq:NN \__notestobib_filesw: \if@filesw \@fileswfalse - \cs_set_nopar:Npn \__niib_aux_hook: + \cs_set_nopar:Npn \__notestobib_aux_hook: { - \cs_set_eq:NN \if@filesw \__niib_filesw: - \cs_set_nopar:Npn \__niib_aux_hook: { } + \cs_set_eq:NN \if@filesw \__notestobib_filesw: + \cs_set_nopar:Npn \__notestobib_aux_hook: { } } - \__niib_cite:w {#1} + \__notestobib_cite:w {#1} } - \cs_new_nopar:Npn \__niib_aux_hook: { } - \tl_gput_right:Nn \g__niib_document_hook_tl + \cs_new_nopar:Npn \__notestobib_aux_hook: { } + \tl_gput_right:Nn \g__notestobib_document_hook_tl { \cs_if_exist:NF \@restore@auxhandle { \tl_new:N \@restore@auxhandle } - \tl_put_right:Nn \@restore@auxhandle { \__niib_aux_hook: } + \tl_put_right:Nn \@restore@auxhandle { \__notestobib_aux_hook: } } } { } @@ -410,60 +410,60 @@ \NewDocumentCommand \bibnote { o +m } { \IfNoValueTF {#1} { - \int_gincr:N \g__niib_note_int - \__niib_bibnote:xn { \__niib_note_name: } {#2} + \int_gincr:N \g__notestobib_note_int + \__notestobib_bibnote:xn { \__notestobib_note_name: } {#2} } - { \__niib_bibnote:xn { \__niib_insert_refsection: #1 } {#2} } + { \__notestobib_bibnote:xn { \__notestobib_insert_refsection: #1 } {#2} } } -\cs_new_protected:Npn \__niib_bibnote:nn #1#2 { - \__niib_write_note:nn {#1} {#2} - \__niib_mark_note:n {#1} +\cs_new_protected:Npn \__notestobib_bibnote:nn #1#2 { + \__notestobib_write_note:nn {#1} {#2} + \__notestobib_mark_note:n {#1} } -\cs_generate_variant:Nn \__niib_bibnote:nn { x } +\cs_generate_variant:Nn \__notestobib_bibnote:nn { x } \NewDocumentCommand \bibnotemark { o } { \IfNoValueTF {#1} { - \int_gincr:N \g__niib_note_int - \__niib_mark_note:x { \__niib_note_name: } + \int_gincr:N \g__notestobib_note_int + \__notestobib_mark_note:x { \__notestobib_note_name: } } - { \__niib_mark_note:x { \__niib_insert_refsection: #1 } } + { \__notestobib_mark_note:x { \__notestobib_insert_refsection: #1 } } } \NewDocumentCommand \bibnotetext { o +m } { \IfNoValueTF {#1} - { \__niib_write_note:xn { \__niib_note_name: } {#2} } - { \__niib_write_note:xn { \__niib_insert_refsection: #1 } {#2} } + { \__notestobib_write_note:xn { \__notestobib_note_name: } {#2} } + { \__notestobib_write_note:xn { \__notestobib_insert_refsection: #1 } {#2} } } \NewDocumentCommand \recordnotes { } { - \__niib_record_notes: + \__notestobib_record_notes: } \NewDocumentCommand \bibnotesetup { m } { \keys_set:nn { notes2bib } {#1} } \NewDocumentCommand \printbibnotes { } { - \__niib_print_notes: + \__notestobib_print_notes: } \NewDocumentCommand \citenote { m } { - \__niib_mark_note:n {#1} + \__notestobib_mark_note:n {#1} } \cs_new_eq:NN \flushnotestack \recordnotes \cs_new_eq:NN \niibsetup \bibnotesetup \cs_new_protected_nopar:Npn \NotesAfterCitations #1 { - \clist_gput_right:Nn \g__niib_previous_after_clist {#1} + \clist_gput_right:Nn \g__notestobib_previous_after_clist {#1} } \cs_new_protected_nopar:Npn \NotesBeforeCitations #1 { - \clist_gput_right:Nn \g__niib_previous_after_clist {#1} - \tl_gput_right:Nn \g__niib_document_hook_tl { \nocite {#1} } + \clist_gput_right:Nn \g__notestobib_previous_after_clist {#1} + \tl_gput_right:Nn \g__notestobib_document_hook_tl { \nocite {#1} } } \cs_new_protected_nopar:Npn \TotalNotes #1 { - \int_gset:Nn \g__niib_previous_notes_int {#1} + \int_gset:Nn \g__notestobib_previous_notes_int {#1} } -\tl_gput_right:Nn \document { \g__niib_document_hook_tl } -\tl_new:N \g__niib_document_hook_tl -\AtEndDocument { \__niib_record_notes: } +\tl_gput_right:Nn \document { \g__notestobib_document_hook_tl } +\tl_new:N \g__notestobib_document_hook_tl +\AtEndDocument { \__notestobib_record_notes: } \AtEndDocument { - \tl_if_eq:NNTF \g__niib_all_before_clist \g__niib_previous_before_clist + \tl_if_eq:NNTF \g__notestobib_all_before_clist \g__notestobib_previous_before_clist { - \tl_if_eq:NNF \g__niib_all_after_clist \g__niib_previous_after_clist + \tl_if_eq:NNF \g__notestobib_all_after_clist \g__notestobib_previous_after_clist { \msg_info:nn { notes2bib } { rerun } } } { \msg_info:nn { notes2bib } { rerun } } @@ -476,32 +476,32 @@ } \AtEndDocument { \if@filesw - \exp_after:wN \__niib_write_note_file: + \exp_after:wN \__notestobib_write_note_file: \fi: } -\cs_new_protected_nopar:Npn \__niib_write_note_file: { - \tl_if_empty:NF \g__niib_notes_tl { - \iow_open:Nn \g__niib_file_iow { \g__niib_filename_tl .bib } - \iow_now:Nx \g__niib_file_iow { \c__niib_file_message_tl } - \iow_now:Nx \g__niib_file_iow - { \exp_not:V \g__niib_notes_tl } - \iow_close:N \g__niib_file_iow +\cs_new_protected_nopar:Npn \__notestobib_write_note_file: { + \tl_if_empty:NF \g__notestobib_notes_tl { + \iow_open:Nn \g__notestobib_file_iow { \g__notestobib_filename_tl .bib } + \iow_now:Nx \g__notestobib_file_iow { \c__notestobib_file_message_tl } + \iow_now:Nx \g__notestobib_file_iow + { \exp_not:V \g__notestobib_notes_tl } + \iow_close:N \g__notestobib_file_iow } } -\iow_new:N \g__niib_file_iow +\iow_new:N \g__notestobib_file_iow \AtEndDocument { - \int_compare:nNnT \g__niib_note_int > \c_zero + \int_compare:nNnT \g__notestobib_note_int > \c_zero { \iow_now:Nx \@auxout - { \TotalNotes { \int_to_arabic:n { \g__niib_note_int } } } + { \TotalNotes { \int_to_arabic:n { \g__notestobib_note_int } } } } } \cs_set:Npn \thanks #1 { - \__niib_footnotemark:w + \__notestobib_footnotemark:w \protected@xdef \@thanks { \@thanks - \protect \__niib_footnotetext:w [ \the \c@footnote ] {#1} + \protect \__notestobib_footnotetext:w [ \the \c@footnote ] {#1} } } \keys_set:nn { notes2bib } { placement = mixed } -- cgit v1.2.3