diff options
author | Karl Berry <karl@freefriends.org> | 2007-10-28 22:19:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-10-28 22:19:43 +0000 |
commit | 8194be0d381007aea01bfe7bce63ad7d10291d66 (patch) | |
tree | 1578ed5767160ebe84a0acdfd9fe88f420ae0ef7 /Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty | |
parent | 2dda0af8aa0d9601d3e62134b33289044aed6ad5 (diff) |
notes2bib update (27oct07)
git-svn-id: svn://tug.org/texlive/trunk@5298 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.sty | 149 |
1 files changed, 100 insertions, 49 deletions
diff --git a/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty b/Master/texmf-dist/tex/latex/notes2bib/notes2bib.sty index 760db640055..4ec2fdfce2a 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} - [2007/09/29 v1.1 Integrating notes into the bibliography] + [2007/10/26 v1.2 Integrating notes into the bibliography] \@ifundefined{eTeXversion} {\PackageError{notes2bib} {Not running under e-TeX} @@ -24,7 +24,7 @@ pdfTeX, try `pdfelatex'\MessageBreak instead of `pdflatex'}% \endinput} {} -\RequirePackage{elatex}[2007/07/13] +\RequirePackage{etoolbox} \newif\ifniib@fn\niib@fnfalse \DeclareOption{footnotes}{% \niib@fntrue @@ -47,7 +47,7 @@ \newif\ifniib@head\niib@headfalse \DeclareOption{tail}{\niib@tailtrue} \DeclareOption{head}{\niib@headtrue} -\ProcessOptions +\ProcessOptions\relax \ifniib@fn \let\niib@fnmark\footnotemark \let\niib@fntext\footnotetext @@ -164,15 +164,9 @@ body\MessageBreak Not modifying citation macro \@nameuse{#1}} } \ifniib@tail - \newrobustcmd*\citenote[2][\relax]{% - \begingroup% - \@fileswfalse% - \ifx#1\relax% - \niibcite{#2}% - \else - \niibcite[#1]{#2}% - \fi - \endgroup% + \newrobustcmd*\citenote{% + \niib@cnfalse% + \niibcite% }% \else \newrobustcmd*\citenote{\niibcite}% @@ -197,44 +191,104 @@ This file may safely be deleted. It will be recreated as required.^^J} \let\niib@stack\relax -\newif\ifniib@cn\niib@cnfalse +\newif\ifniib@cn\niib@cnfalse% +\newif\ifniib@citing\niib@citingfalse% +\newif\ifniib@filesw\niib@fileswfalse% +\newif\ifniib@orig@filesw +\if@filesw + \niib@orig@fileswtrue% +\else + \niib@orig@fileswfalse% +\fi +\def\niib@head@filesw{% + \let\@fileswtrue\niib@orig@fileswtrue% + \let\@fileswfalse\niib@orig@fileswfalse% + \def\if@filesw{% + \ifniib@orig@filesw + \niib@fileswtrue% + \else + \niib@fileswfalse% + \fi + \ifniib@citing + \ifniib@cn\else + \niib@fileswfalse% + \fi + \fi + \global\niib@cnfalse% + \global\niib@citingfalse% + \ifniib@filesw% + } +} +\ifniib@head + \niib@head@filesw% +\fi +\def\niib@tail@filesw{% + \let\@fileswtrue\niib@orig@fileswtrue% + \let\@fileswfalse\niib@orig@fileswfalse% + \def\if@filesw{% + \ifniib@orig@filesw + \niib@fileswtrue% + \else + \niib@fileswfalse% + \fi + \ifniib@cn + \niib@fileswfalse% + \fi + \global\niib@cnfalse% + \ifniib@filesw% + } +} +\ifniib@tail + \niib@tail@filesw% +\fi \newrobustcmd*\niib@delaycite[1]{% \@ifundefined{#1}{% - \PackageWarning{notes2bib} - {Citation macro \@nameuse{#1}undefined\MessageBreak - \protect\delaycite\space cannot operate on this macro} + \PackageWarning{notes2bib} + {Citation macro \@nameuse{#1}undefined\MessageBreak + \protect\delaycite\space cannot operate on this macro} }{% \@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]{% - \ifniib@cn% - \csname niib@orig@#1\endcsname{##2}% - \else% - \begingroup% - \@fileswfalse% - \ifx##1\relax% - \csname niib@orig@#1\endcsname{##2}% - \else% - \csname niib@orig@#1\endcsname[##1]{##2}% - \fi% - \endgroup% - \edef\niib@temp{##2}% - \ifx\niib@stack\relax% - \xdef\niib@stack{\niib@temp}% - \else% - \xdef\niib@stack{\niib@stack,\niib@temp}% - \fi% - \fi% - }% - \PackageInfo{notes2bib}% - {Modifying citation type \@nameuse{#1}}% + \expandafter\renewcommand\csname #1\endcsname{% + \niib@citingtrue% + \@ifnextchar[%] + {\@nameuse{niib@optarg@#1}} + {\@nameuse{niib@noarg@#1}} + } + \expandafter\def\csname niib@optarg@#1\endcsname[##1]{% + \@ifnextchar[%] + {\@nameuse{niib@twoopt@#1}[##1]} + {\@nameuse{niib@oneopt@#1}[##1]} + } + \expandafter\def\csname niib@oneopt@#1\endcsname[##1]##2{% + \niib@stackup{##2}% + \@nameuse{niib@orig@#1}[##1]{##2}% + } + \expandafter\def\csname niib@twoopt@#1\endcsname[##1][##2]##3{% + \niib@stackup{##3}% + \@nameuse{niib@orig@#1}[##1][##2]{##3}% + } + \expandafter\def\csname niib@noarg@#1\endcsname##1{% + \niib@stackup{##1}% + \@nameuse{niib@orig@#1}{##1}% + } }{% \PackageInfo{notes2bib}% {Already delayed \@nameuse{#1}}% - }% + } } } +\def\niib@stackup#1{% + \ifniib@cn\else + \edef\niib@temp{#1}% + \ifx\niib@stack\relax% + \xdef\niib@stack{\niib@temp}% + \else + \xdef\niib@stack{\niib@stack,\niib@temp}% + \fi + \fi +} \long\def\niib@bibnote[#1]#2{% \niib@text{#1}{#2}% \niib@cite{#1}% @@ -244,20 +298,17 @@ \def\niib@cite#1{% \niib@cntrue% \niibcite{#1}% - \niib@cnfalse% }% \else% \ifniib@tail% \def\niib@cite#1{% - \ifx\niib@stack\relax% - \xdef\niib@stack{#1}% - \else% - \xdef\niib@stack{\niib@stack,#1}% - \fi% - \begingroup - \@fileswfalse% + \ifx\niib@stack\relax% + \xdef\niib@stack{#1}% + \else% + \xdef\niib@stack{\niib@stack,#1}% + \fi% + \niib@cntrue% \niibcite{#1}% - \endgroup% }% \else% \def\niib@cite#1{\niibcite{#1}}% @@ -283,7 +334,7 @@ } \@ifpackageloaded{biblatex}{% \expandafter\bib@gadd\expandafter\blx@bibfiles\expandafter% - {\niibprefix\jobname}% + {,\niibprefix\jobname}% }{% \let\niib@bib\bibliography% \renewcommand{\bibliography}[1]{% |