summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx')
-rw-r--r--Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx102
1 files changed, 93 insertions, 9 deletions
diff --git a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx
index a22d12ce741..c5b2d6f5b9d 100644
--- a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx
+++ b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx
@@ -144,7 +144,7 @@ unsorted bibliography styles are supported.
%</driver>
%\fi
%
-%\CheckSum{868}
+%\CheckSum{881}
%
%\CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -182,6 +182,8 @@ unsorted bibliography styles are supported.
% control option to turn off use even if available}
%\changes{v1.5}{2008/09/08}{Bundle now includes experimental
% \LaTeX3 support}
+%\changes{v1.6}{2008/10/21}{Fixed issue with \cs{nofiles}}
+%\changes{v1.6}{2008/10/21}{Advice extended on various issues}
%
%\DoNotIndex{\@auxout,\@empty,\@fileswfalse,\@for,\@ifnextchar}
%\DoNotIndex{\@ifpackagelater,\@ifpackageloaded,\@ifundefined}
@@ -205,7 +207,7 @@ unsorted bibliography styles are supported.
%\DoNotIndex{\c@footnote,\catcode,\define@key,\dospecials,\global}
%
%\setkeys{lst}{language=[LaTeX]{TeX},moretexcs={bibnote,%
-% bibnotemark,bibnotetext,citenote}}
+% bibnotemark,bibnotetext,citenote,niibsetup,newif,printbibliography}}
%
%\title{\currpkg\ --- Integrating notes into the
% bibliography^^A
@@ -323,6 +325,8 @@ unsorted bibliography styles are supported.
%\DescribeOption{field}
%\DescribeOption{name}
%\DescribeOption{record}
+%\DescribeOption{keyword}
+%\changes{v1.6}{2008/10/22}{New option \opt{keyword}}
% A number of options control the data added to the \BibTeX\
% database. The \opt{field} and \opt{record} options control the type
% of \BibTeX\ entry created by \currpkg. On loading, \opt{record} is
@@ -331,7 +335,9 @@ unsorted bibliography styles are supported.
% choices may exist for these settings. The \opt{name} option is used
% to automatically generate citation names. The option starts with
% the value \defaultopt{Bibnote}, which may need to change for
-% author--year styles in particular.
+% author--year styles in particular. For separating notes from other
+% citations when using \pkg{biblatex}, the \opt{keyword} option is used
+% for the name of the keyword used to control this.
%\DescribeOption{prefix}
% The name of the database itself is controlled by the \opt{prefix}
% option. This contains the ``marker'' used by \currpkg to attach to
@@ -365,6 +371,13 @@ unsorted bibliography styles are supported.
% the appropriate values; default values are \defaultopt{ml},
% \defaultopt{mm} and \defaultopt{ml}, respectively.
%
+%\DescribeOption{writekey}
+% 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{writekey} is available to turn off writing the
+% \texttt{key} field under these circumstances.
+%
%\DescribeOption{log}
%\DescribeOption{debug}
% The amount of detail to add to the log; expects a value from the
@@ -442,12 +455,58 @@ unsorted bibliography styles are supported.
%\begin{LaTeXexample}[noexample]
% \makeatletter
% \renewcommand*{\thebibnote}{%
-% \niib@name%
-% \ifnum\value{bibnote} < 9 0\fi%
+% \niib@name
+% \ifnum\value{bibnote} < 9 0\fi
% \the\value{bibnote}}
% \makeatother
%\end{LaTeXexample}
%
+% Using the package with \pkg{natbib} may require some work, for example
+% when using the \texttt{unsrtnat} style. This requires a couple of
+% setting changes to get the correct labelling.\footnote{This is due to
+% the method used by \pkg{natbib} when creating labels.}
+%\begin{LaTeXexample}[noexample]
+% \niibsetup{writekey=false,name={}}
+%\end{LaTeXexample}
+%
+% Notes can be separated from other citations easily using
+% \pkg{biblatex}. Using the \opt{keyword} option, a key phrase can be
+% used to mark notes. The optional argument to the
+% \cs{printbibliography} can then be used to separate notes and
+% other citations based on the keyword used. The following example
+% also places note citations in the margin, and makes a switch available
+% to control the appearance of notes. Note that the standard keyword is
+% \opt{bibnote}.
+%\begin{LaTeXexample}[noexample]
+% \documentclass{article}
+% \begin{filecontents}{demo.bib}
+% @article{Test,
+% title = {A test article},
+% author = {A. N. Other},
+% year = {2008},
+% pages = {1-10}
+% }
+% \end{filecontents}
+% \usepackage{notes2bib,biblatex}
+% \defbibheading{notes}{\section*{Notes}}
+% \bibliography{demo}
+% \newif\ifprintbibnotes\printbibnotesfalse
+% \niibsetup{cite=mycite}
+% \ifprintbibnotes
+% \newcommand*{\mycite}[1]{\marginpar{\cite{#1}}}
+% \else
+% \newcommand*{\mycite}[1]{}
+% \fi
+% \begin{document}
+% Some text\bibnote{A first note} and some more\bibnote{A second note}.
+% A real citation \cite{Test}.
+% \printbibliography[notkeyword=bibnote]
+% \ifprintbibnotes
+% \printbibliography[heading=notes,keyword=bibnote]
+% \fi
+% \end{document}
+%\end{LaTeXexample}
+%
%\section{Package requirements}
% The package has only one requirement, \pkg{xkeyval} version 2.5 or
% later. \eTeX\ is used if available, but is not a requirement.
@@ -562,7 +621,7 @@ unsorted bibliography styles are supported.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{notes2bib}
- [2008/09/24 v1.5b Integrating notes into the bibliography]
+ [2008/10/22 v1.6 Integrating notes into the bibliography]
\RequirePackage{xkeyval}[2005/05/07]
% \end{macrocode}
%\begin{macro}{\niib@tempa}
@@ -769,6 +828,13 @@ unsorted bibliography styles are supported.
\fi
\fi]{tail}
% \end{macrocode}
+%\begin{macro}{\niib@writekey}
+%\changes{v1.6}{2008/10/21}{Added \opt{writekey} option}
+% Control of writing \texttt{key} to disk.
+% \begin{macrocode}
+\niib@opt@boolkey{writekey}
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\niib@cite}
%\begin{macro}{\niib@name}
%\begin{macro}{\niib@prefix}
@@ -780,6 +846,7 @@ unsorted bibliography styles are supported.
%\begin{macro}{\niib@keyhead}
%\begin{macro}{\niib@keynone}
%\begin{macro}{\niib@keytail}
+%\begin{macro}{\niib@keyword}
% The various internal control values are set up as command keys.
% \begin{macrocode}
\niib@opt@cmdkeys{%
@@ -793,7 +860,8 @@ unsorted bibliography styles are supported.
presorttail,
keyhead,
keynone,
- keytail}
+ keytail,
+ keyword}
\niibsetup{
cite=cite,
name=Bibnote,
@@ -805,7 +873,9 @@ unsorted bibliography styles are supported.
presorttail=mn,
keyhead=aaa,
keynone={},
- keytail=zzz}
+ keytail=zzz,
+ keyword=bibnote,
+ writekey=true}
% \end{macrocode}
%\end{macro}
%\end{macro}
@@ -818,6 +888,7 @@ unsorted bibliography styles are supported.
%\end{macro}
%\end{macro}
%\end{macro}
+%\end{macro}
%\begin{macro}{\ifniib@etex}
% The option to turn off \eTeX\ needs to ensure that the user does
% not ask for \eTeX\ if it is not there. On the other hand, the
@@ -1307,11 +1378,21 @@ unsorted bibliography styles are supported.
{}%
\if@filesw
\expandafter\niib@write
+ \else
+ \expandafter\niib@tidy
\fi}
% \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
+%\begin{macro}{\niib@tidy}
+% When not writing to file.
+% \begin{macrocode}
+\newcommand*{\niib@tidy}[2]{%
+ \@esphack
+ \niib@next[#1]}
+% \end{macrocode}
+%\end{macro}
%\begin{macro}{\niib@write}
% The \cs{niib@write} macro deals with writing data verbatim to the
% \BibTeX\ file. When \eTeX\ is available, this is easy; the macro
@@ -1325,7 +1406,10 @@ unsorted bibliography styles are supported.
\immediate\write\niib@out{%
@\niib@record\string{#1,^^J%
presort = \string{\niib@presort\string},^^J%
- \niib@keyname\space= \string{\niib@key#1\string},^^J%
+ \ifniib@writekey
+ \niib@keyname\space= \string{\niib@key#1\string},^^J%
+ \fi
+ keywords = \string{\niib@keyword\string},^^J%
\niib@field\space= \string{\unexpanded{#2}\string}^^J%
\string}^^J}%
\@esphack