summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-01-17 07:19:17 +0000
committerNorbert Preining <preining@logic.at>2008-01-17 07:19:17 +0000
commitc37c1e5d8d50ed07fe74713f336af62d90ef9556 (patch)
treef82a33d8f697e10333a33110670d8162e1fe1368 /Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
parentaebc1a2b64ca58e39d021df69964197869140e19 (diff)
notes2bib update from ctan
git-svn-id: svn://tug.org/texlive/trunk@6277 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty')
-rw-r--r--Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty81
1 files changed, 53 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty
index 8a33989a8b1..6ec80a119a7 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/01/09 v1.3a Integrating notes into the bibliography]
+ [2008/01/16 v1.3b Integrating notes into the bibliography]
\begingroup
\@ifundefined{eTeXversion}
{\PackageError{notes2bib}
@@ -262,16 +262,24 @@
{\niib@mark[\thebibnote]}}
\DeclareRobustCommand*{\bibnotetext}[1][\thebibnote]{%
\niib@text{#1}}
-\@ifpackageloaded{biblatex}
- {\let\printbibnotes\printbibliography}
- {\DeclareRobustCommand*{\printbibnotes}
- {\niib@org@bib{\niib@prefix\jobname}}}
+\AtBeginDocument{%
+ \@ifpackageloaded{biblatex}
+ {\let\printbibnotes\printbibliography}
+ {\DeclareRobustCommand*{\printbibnotes}
+ {\niib@org@bib{\niib@prefix\jobname}}}}
\DeclareRobustCommand*{\flushnotestack}{%
+ \let\niib@taillist\niib@stack
+ \ifniib@rerun\else
+ \niib@checkrerun{tail}%
+ \fi
\ifx\@empty\niib@stack\@empty
\niib@log@debug{Citation stack empty: nothing for\MessageBreak
\noexpand\flushnotestack to do}%
\else%
\niib@log@debug{Flushing note citations to aux file}%
+ \if@filesw
+ \immediate\write\@auxout{\string\niibtailcite{\niib@stack}}%
+ \fi
\expandafter\nocite\expandafter{\niib@stack}%
\gdef\niib@stack{}%
\fi}
@@ -308,7 +316,7 @@
required.^^J}
\newcommand*{\niib@stack}{}
\newcommand*{\niib@addtostack}[1]{%
- \niib@log@debug{Adding citation #1 to stack}%
+ \niib@log@debug{Adding citation #1\MessageBreak to `tail' stack}%
\edef\niib@tempa{#1}%
\ifx\@empty\niib@stack\@empty
\xdef\niib@stack{\niib@tempa}%
@@ -395,6 +403,14 @@
\niib@log@debug{Adding citation #1 to start of .aux file}%
\fi
\g@addto@macro{\niib@dochook}{\nocite{#1}}}
+\newcommand*{\niib@tailcitelist}{}
+\newcommand*{\niibtailcite}[1]{%
+ \edef\niib@tempa{#1}%
+ \ifx\@empty\niib@tailcitelist\@empty
+ \xdef\niib@tailcitelist{\niib@tempa}%
+ \else
+ \xdef\niib@tailcitelist{\niib@tailcitelist,\niib@tempa}%
+ \fi}
\newcommand*{\niib@dochook}{%
\@ifundefined{@restore@auxhandle}
{\newcommand*{\@restore@auxhandle}{\niib@auxhook}}
@@ -420,29 +436,33 @@
\niib@log@debug{Added bibnote database to
\noexpand\bibliography}}}
\newif\ifniib@rerun
-\newcommand*{\niib@checkrerun}{%
+\newcommand*{\niib@checkrerun}[1]{%
\niib@rerunfalse
- \ifx\@empty\niib@headlist\@empty
- \ifx\@empty\niib@headcitelist\@empty
- \niib@log@debug{No `head' notes detected}%
+ \expandafter\ifx\expandafter\@empty\csname niib@#1list\endcsname%
+ \@empty
+ \expandafter\ifx\expandafter\@empty\csname niib@#1citelist%
+ \endcsname\@empty
+ \niib@log@debug{No `#1' notes detected}%
\else
\niib@reruntrue
- \niib@log@debug{No `head' notes found this run\MessageBreak
- but .aux files contained the `head' requests:\MessageBreak
- \niib@headcitelist}%
+ \niib@log@debug{No `#1' notes found this run\MessageBreak
+ but .aux files contained the `#1' requests:\MessageBreak
+ \csname niib@#1citelist\endcsname}%
\fi
\else
- \ifx\@empty\niib@headcitelist\@empty
+ \expandafter\ifx\expandafter\@empty\csname niib@#1citelist%
+ \endcsname\@empty
\niib@reruntrue
- \niib@log@debug{No `head' requests in .aux file\MessageBreak
- but `head' notes in this run:\MessageBreak
- \niib@headlist}%
+ \niib@log@debug{No `#1' requests in .aux file\MessageBreak
+ but `#1' notes in this run:\MessageBreak
+ \csname niib@#1list\endcsname}%
\else
- \niib@checklists%
+ \niib@checklists{#1}%
\fi
\fi
\ifniib@rerun
- \niib@log@warn{Rerun LaTeX to get correct `head' notes}%
+ \niib@log@warn{Rerun LaTeX to get correct \MessageBreak
+ `#1' notes}%
\niib@log@warn{Please (re)run BibTeX on the file(s):
\MessageBreak\jobname.aux
\MessageBreak and rerun LaTeX afterwards.}%
@@ -453,32 +473,37 @@
REQ:1:latex:REQ}%
\fi
\fi}
-\newcommand*{\niib@checklists}{%
- \@for\niib@tempa:=\niib@headlist\do{%
+\newcommand*{\niib@checklists}[1]{%
+ \expandafter\edef\expandafter\niib@list\expandafter%
+ {\csname niib@#1list\endcsname}%
+ \expandafter\edef\expandafter\niib@citelist\expandafter%
+ {\csname niib@#1citelist\endcsname}%
+ \@for\niib@tempa:=\niib@list\do{%
\niib@reruntrue
- \@for\niib@tempb:=\niib@headcitelist\do{%
+ \@for\niib@tempb:=\niib@citelist\do{%
\ifx\niib@tempa\niib@tempb
\niib@rerunfalse
\fi}
\ifniib@rerun
- \niib@log@debug{Note \niib@tempa is a `head' note
+ \niib@log@debug{Note \niib@tempa\space is a `#1' note
\MessageBreak but request not in .aux file}%
\fi}
\ifniib@rerun\else
- \@for\niib@tempa:=\niib@headcitelist\do{%
+ \@for\niib@tempa:=\niib@citelist\do{%
\niib@reruntrue
- \@for\niib@tempb:=\niib@headlist\do{%
+ \@for\niib@tempb:=\niib@list\do{%
\ifx\niib@tempa\niib@tempb
\niib@rerunfalse
\fi}
\ifniib@rerun
- \niib@log@debug{Note \niib@tempa is set to `head' in
- .aux\MessageBreak file but is not a `head' note}%
+ \niib@log@debug{Note \niib@tempa\space is set to `#1' in
+ .aux\MessageBreak file but is not a `#1' note}%
\fi}
\fi}
\AtEndDocument{%
+ \niib@rerunfalse
+ \niib@checkrerun{head}%
\flushnotestack%
- \niib@checkrerun%
\@ifundefined{niib@out}{}
{\immediate\closeout\niib@out%
\niib@log@debug{Closed BibTeX database file\MessageBreak