summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx')
-rw-r--r--Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx81
1 files changed, 52 insertions, 29 deletions
diff --git a/Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx b/Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx
index 199e2137cea..6cd5acce8c2 100644
--- a/Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx
+++ b/Master/texmf-dist/source/latex/notes2bib/xnotes2bib.dtx
@@ -95,7 +95,7 @@ This work consists of the file notes2bib.dtx
%</internal>
%<*package>
\RequirePackage{l3names}
-\GetIdInfo$Id: xnotes2bib.dtx 4 2008-09-23 09:00:00Z joseph $
+\GetIdInfo$Id: xnotes2bib.dtx 5 2008-10-22 21:00:00Z joseph $
{Integrating notes into the bibliography (expl3 version)}
%</package>
%<*driver>
@@ -110,7 +110,7 @@ This work consists of the file notes2bib.dtx
%</driver>
% \fi
%
-%\CheckSum{461}
+%\CheckSum{466}
%
%\GetFileInfo{\jobname.sty}
%
@@ -237,6 +237,13 @@ This work consists of the file notes2bib.dtx
% with default values \opt{mn}, \opt{ml} and \opt{mm}, respectively.
% The \opt{presort} system is described in the \pkg{biblatex} manual.
%
+%\DescribeOption{write~key~field}
+% When using the package with \pkg{natbib}, it may be necessary to avoid
+% writing the \texttt{key} field to the temporary database. This is
+% seen with the style \texttt{unsrtnat}, for example. The Boolean
+% option \opt{write key field} is available to turn off writing the
+% \texttt{key} field under these circumstances.
+%
%\DescribeOption{cite}
% As \currpkg\ uses \BibTeX\ to create notes, it uses a citation
% command to mark the notes in the body of the text. The command used
@@ -244,7 +251,7 @@ This work consists of the file notes2bib.dtx
% \cs{cite}.
%
%\DescribeOption{field}
-%\DescribeOption{notename}
+%\DescribeOption{name}
%\DescribeOption{prefix}
%\DescribeOption{record}
% Four control values are available to affect low-level aspects of the
@@ -253,7 +260,7 @@ This work consists of the file notes2bib.dtx
% \opt{niib-} initially. The \opt{field} and \opt{record} options
% contain the name of the field used for the note, and the \BibTeX\
% record type used. The standard values are \opt{note} and \opt{Misc},
-% respectively. Finally, the \opt{notename} option sets the text used
+% respectively. Finally, the \opt{name} option sets the text used
% in addition to a number when automatically labelling notes. This is
% set to \opt{Bibnote}: there is no space between this text and the
% number as this will confuse \BibTeX.
@@ -381,7 +388,7 @@ This work consists of the file notes2bib.dtx
% so that if there are more than ten notes then the number is padded.
% \begin{macrocode}
\def_new:Npn \niib_thenote: {
- \l_niib_notename_tlp
+ \l_niib_name_tlp
\num_compare:nNnT {\g_niib_totalnotes_int} > {\c_nine} {
\num_compare:nNnF {\g_niib_note_int} > {\c_nine} {
0
@@ -462,7 +469,9 @@ This work consists of the file notes2bib.dtx
%\changes{v0.0}{2008/09/15}{Renamed from \cs{l_niib_key before_tlp}}
%\begin{macro}{\l_niib_key_mixed_tlp}
%\changes{v0.0}{2008/09/15}{Renamed from \cs{l_niib_key mixed_tlp}}
-%\begin{macro}{\l_niib_notename_tlp}
+%\begin{macro}{\l_niib_keyword_tlp}
+%\begin{macro}{\l_niib_name_tlp}
+%\changes{v0.0}{2008/09/15}{Renamed from \cs{l_niib_notename_tlp}}
% Some storage macros.
% \begin{macrocode}
/keys/current~module:n = niib,
@@ -470,13 +479,15 @@ This work consists of the file notes2bib.dtx
key~after/.set:c = key_after,
key~before/.set:c = key_before,
key~mixed/.set:c = key_mixed,
- notename/.set:c = notename,
+ keyword/.set:c = keyword,
+ name/.set:c = name,
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
% Another choice for placement.
% \begin{macrocode}
placement/.choice: = \l_niib_placement_tlp,
@@ -506,35 +517,43 @@ This work consists of the file notes2bib.dtx
%\changes{v0.0}{2008/09/09}{Renamed and recoded from
% \cs{niib_KV_string:n}}
% \begin{macrocode}
- prefix/.set:c = prefix_tlp,
+ /keys/current~module:n = niib,
+ prefix/.set:c = prefix,
presort~after/.set:c = presort_after,
presort~before/.set:c = presort_before,
presort~mixed/.set:c = presort_mixed,
- record/.set:c = record
-}
+ record/.set:c = record,
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
+%\begin{macro}{\l_niib_write_key_bool}
+% One real Boolean key.
+% \begin{macrocode}
+ write~key~field/.boolean:c = write_key
+}
+% \end{macrocode}
+%\end{macro}
% All of the default values are set.
% \begin{macrocode}
\keys_manage_quick:n{
/niib/.cd:,
- cite = \cite,
- debug = false,
- field = note,
- key~after = zzz,
- key~before = aaa,
- key~mixed = {},
- notename = Bibnote,
- placement = mixed,
- prefix = niib-,
- presort~after = mn,
- presort~before = ml,
- presort~mixed = mm,
- record = Misc}
+ cite = \cite,
+ debug = false,
+ field = note,
+ key~after = zzz,
+ key~before = aaa,
+ key~mixed = {},
+ name = Bibnote,
+ placement = mixed,
+ prefix = niib-,
+ presort~after = mn,
+ presort~before = ml,
+ presort~mixed = mm,
+ record = Misc,
+ write~key~field = true}
% \end{macrocode}
%
%\subsection{User macros}
@@ -547,7 +566,7 @@ This work consists of the file notes2bib.dtx
% \cs{niib_thenote:}. The note text must be sorted out before the mark
% is made, as otherwise packages such as \pkg{cite} do not work
% correctly with punctuation. As the package is designed for \LaTeX3,
-% it is assumed \eTeX\ is available and so \cs{scantokens} can be used
+% it is assumed \eTeX\ is available and so \cs{exp_not:n} can be used
% on the mandatory argument. Hence everything is absorbed here without
% worrying about category codes.
% \begin{macrocode}
@@ -618,8 +637,12 @@ This work consists of the file notes2bib.dtx
#1,^^J
\text_put_sp: \text_put_sp: \l_niib_field_tlp \text_put_sp:
=~{\exp_not:n{#2}},^^J
- \text_put_sp: \text_put_sp: \l_niib_keyname_tlp \text_put_sp:
- =~{\niib_key:#1},^^J
+ \bool_if:NT \l_niib_write_key_bool {
+ \text_put_sp: \text_put_sp: \l_niib_keyname_tlp \text_put_sp:
+ =~{\niib_key:#1},^^J
+ }
+ \text_put_sp: \text_put_sp: keywords~
+ =~{\l_niib_keyword_tlp},^^J
\text_put_sp: \text_put_sp: presort~
=~{\niib_presort:},^^J
}^^J
@@ -785,12 +808,12 @@ This work consists of the file notes2bib.dtx
}
\def_new:Npn \niib_presort: {
\bool_if:NTF \l_niib_before_cite_bool {
- \tlp_use:N \l_niib_presort~before_tlp
+ \tlp_use:N \l_niib_presort_before_tlp
}{
\bool_if:NTF \l_niib_after_cite_bool {
- \tlp_use:N \l_niib_presort~after_tlp
+ \tlp_use:N \l_niib_presort_after_tlp
}{
- \tlp_use:N \l_niib_presort~mixed_tlp
+ \tlp_use:N \l_niib_presort_mixed_tlp
}
}
}