From c9c46ee3e0affbd186d61b95b6cf4db1b0127fb1 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 4 Sep 2007 18:07:34 +0000 Subject: notes2bib update (3sep07) git-svn-id: svn://tug.org/texlive/trunk@4875 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/notes2bib/notes2bib.dtx | 54 ++++++++++++++++++---- 1 file changed, 44 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/source/latex/notes2bib') diff --git a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx index 06c26173a56..b9fe28fdf96 100644 --- a/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx +++ b/Master/texmf-dist/source/latex/notes2bib/notes2bib.dtx @@ -38,7 +38,7 @@ % %\fi % -%\CheckSum{486} +%\CheckSum{498} % %\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 @@ -148,8 +148,8 @@ % replacing footnotes by bibnotes. Notice that there \emph{are} % places where bibnotes will be problematic, for example in section % headings which also appear in the Table of Contents. In these -% contexts, use \cmd{\cite} to reference the note, or use an optional -% argument to the \cmd{\section}, \emph{etc.} +% contexts, use \cmd{\citenote} to reference the note, or use an +% optional argument to the \cmd{\section}, \emph{etc.} % %\subsection{Package options} % The |notes2bib| package currently accepts a number of options. The @@ -209,11 +209,16 @@ % \cmd{\theendnotes} macro is redefined to achieve the same effect. % %\subsection{Cross-referencing notes} +%\DescribeMacro{\citenote} % As explained above, each note is automatically assigned a label, or % the user can provide one as an optional argument to the note. In -% either case, notes may then be cross-referenced. This should be -% done using the \cmd{\cite} command (or similar) as the labels are -% bibliographic citations. +% either case, notes may then be cross-referenced. Notes are +% available to be cited directly using the \cmd{\cite} command. +% However, this can cause problems when using the |tail| option. The +% \cmd{\citenote} command is therefore provided. This is aware of +% the options, and will act correctly in all circumstances. +% \cmd{\citenote} uses the citation command currently defined in +% \cmd{\niibcite}. % %\subsection{Interaction with other packages} % |notes2bib| is designed to work well with as many other packages as @@ -460,7 +465,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{notes2bib} - [2007/08/30 v1.0 Integrating notes into the bibliography] + [2007/09/03 v1.0a Integrating notes into the bibliography] \RequirePackage{xspace} % \end{macrocode} % Option processing takes place. Redefining \cmd{\footnote} or @@ -805,6 +810,8 @@ %\end{macro} % %\begin{macro}{\delaycite} +%\changes{v1.0a}{2007/09/03}{Fixed a flaw with checking for +% existing redefinition} % Normal citations have to be stacked up in the stack when in % ``head'' mode. To do this, the citation command has to be modified % to do this, while leaving note citations alone. The trick used in @@ -812,7 +819,7 @@ % place. % \begin{macrocode} \newcommand*\delaycite[1]{% - \expandafter\ifx\csname niib@orig@#1\endcsname\@undefined% + \@ifundefined{niib@orig@#1}{% \expandafter\expandafter\expandafter\let\expandafter% \csname niib@orig@#1\expandafter\endcsname\csname #1\endcsname% \expandafter\renewcommand\csname #1\endcsname[2][\relax]{% @@ -844,14 +851,41 @@ \fi% \fi% }% - \else% + }{% \PackageInfo{notes2bib}% {Citation type ``#1'' already delayed}% - \fi% + } } % \end{macrocode} %\end{macro} % +%\begin{macro}{\citenote} +%\changes{v1.0a}{2007/09/03}{New macro} +% A ``mode aware'' command for referencing notes is needed (problems +% arise with \cmd{\cite} and the |tail| option. Rather than overload +% \cmd{\cite} with all of the problems that can bring, a new command +% is provided that can be guaranteed to work. +% \begin{macrocode} +\ifniib@tail + \newcommand*\citenote[2][\relax]{% + \begingroup% + \@fileswfalse% +% \end{macrocode} +% \cmd{\relax} is used as a marker for an empty first argument. +% \begin{macrocode} + \ifx#1\relax + \niibcite{#2}% + \else + \niibcite[#1]{#2} + \fi + \endgroup% + } +\else + \newcommand*\citenote{\niibcite} +\fi +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\Percent} % Finally, a way of producing a percentage sign in note is needed. % This is because inside the note, no method for escaping a comment -- cgit v1.2.3