summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/bibtopic
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2006-10-16 22:52:49 +0000
committerNorbert Preining <preining@logic.at>2006-10-16 22:52:49 +0000
commita01c6cd8e1c9d57bfad552d26abc3d40a2f865a7 (patch)
tree4611cbc80da2287554102f482a5557e797306f11 /Master/texmf-dist/tex/latex/bibtopic
parent01bcc21ef0b9d24777341435c9cd374b8bec277c (diff)
add bibtopic to tpm-ctan-check, update bibtopic
git-svn-id: svn://tug.org/texlive/trunk@2337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/bibtopic')
-rw-r--r--Master/texmf-dist/tex/latex/bibtopic/bibtopic.sty74
1 files changed, 65 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/bibtopic/bibtopic.sty b/Master/texmf-dist/tex/latex/bibtopic/bibtopic.sty
index 67744b3920c..9de63b46da0 100644
--- a/Master/texmf-dist/tex/latex/bibtopic/bibtopic.sty
+++ b/Master/texmf-dist/tex/latex/bibtopic/bibtopic.sty
@@ -4,7 +4,7 @@
%%
%% The original source files were:
%%
-%% bibtopic.dtx (with options: `package')
+%% bibtopic.dtx (with options: `package,debug')
%%
%% LaTeX package for multiple bibliographies
%%
@@ -27,8 +27,20 @@
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
%%
-\NeedsTeXFormat{LaTeX2e}[1996/12/01] \ProvidesPackage{bibtopic}[2002/08/22 v1.0k
+\NeedsTeXFormat{LaTeX2e}[1996/12/01] \ProvidesPackage{bibtopic}[2006/09/08 v1.1a
Sectioned Bibliographies]
+\newif\bt@ifdebug
+%%% \bt@debugtrue % uncomment this line to activate global debugging
+\newcommand*\bt@debug[2][]{%
+ \bt@ifdebug
+ \PackageInfo{bibtopic}{#1}%
+ \typeout{DBG: #2}%
+ \else
+ \ifx#1\@empty\else
+ \typeout{DBG (#1): #2}%
+ \fi
+ \fi
+}
\RequirePackage{ifthen}
\newcommand\bt@tempa{}
\newcommand\bt@tempb{}
@@ -154,12 +166,14 @@ Sectioned Bibliographies]
\newcommand*\bt@globalstyle{}%
\newcommand*\bt@defaultstyle{plain}%
\newcommand*\@bt@orig@citation{}
+\bt@debug{saving meaning of \string\citation : \meaning\citation}%
\let\@bt@orig@citation\citation
\ifthenelse{\boolean{bt@fast}}{%
\def\citation#1{%
\@for\bt@tempa:=#1\do{%
\def\@extra@b@citeb{\bt@unit@cnt}%
\global\@namedef{\bt@tempa bt@\@extra@binfo}{}%
+ \bt@debug{defining \bt@temp bt@\@extra@binfo}%
\@bt@orig@citation{\bt@tempa}%
}%
}%
@@ -292,6 +306,8 @@ Sectioned Bibliographies]
\AtEndDocument{%
\immediate\write\@auxout{%
\string\csname\space bt@set@cnt\string\endcsname{\bt@helpctr}}%
+ \bt@debug{restoring meaning of \string\citation :
+ \meaning\@bt@orig@citation}%
\def\citation#1{\@bt@orig@citation{#1}}%
\let\bt@kv@add\@gobbletwo
\bt@files@warnings
@@ -302,11 +318,16 @@ Sectioned Bibliographies]
Rerun to get indentation of bibitems right%
}%
\fi
+ \bt@debug{total number of items: \bt@helpctr}%
}
\newcommand*\bt@savelist{}
\newcommand*\bt@append@list[2]{%
- \let\bt@savelist#2
+ \bt@debug{appending #1 to #2}%
+ \let\bt@savelist#2%
+ \bt@debug{list is: #2}%
+ \bt@debug{bt@savelist is: \bt@savelist}%
\protected@xdef#2{\bt@savelist\@elt{#1}}%
+ \bt@debug{list after append: #2}%
}
\newcommand*\bt@add@elem[2]{%
\bt@if@elem{#1}{#2}{%
@@ -411,6 +432,8 @@ Sectioned Bibliographies]
\newcommand*\bt@save@list[1]{%
\expandafter\protected@xdef\csname bt@sect%
#1\endcsname{\bt@cited@list}%
+ \bt@debug{saving list #1\space is:
+ \csname bt@sect#1\endcsname}%
}
\newcommand\btBegThbCmd{}
\newcommand*\bt@beg@thb@hook{%
@@ -464,25 +487,31 @@ Sectioned Bibliographies]
}{}%
\def\bt@tempa{\bibfont}%
\ifx\bt@tempa\bt@tempc %
+ \bt@debug{assuming natbib v6.x-style thb env}%
\bt@change@nat@thb
\else
\def\bt@tempa{\bibsection}%
\ifx\bt@tempa\bt@tempc
+ \bt@debug{assuming natbib v7-style thb env}%
\bt@change@nat@thb
\else
\def\bt@tempa{\bib@heading}%
\ifx\bt@tempa\bt@tempc
+ \bt@debug{assuming older KOMA-style thb env}%
\bt@change@KOMA@thb
\else
\def\bt@tempa{\chapter}%
\ifx\bt@tempa\bt@tempc
+ \bt@debug{assuming book thb env}%
\bt@change@standard@thb
\else
\def\bt@tempa{\section}%
\ifx\bt@tempa\bt@tempc
+ \bt@debug{assuming article thb env}%
\bt@change@standard@thb
\else
\ifbt@koma@class
+ \bt@debug{assuming newer KOMA-style thb env}%
\bt@change@KOMA@thb
\else
\ifthenelse{\boolean{bt@fallback@thb}}{%
@@ -564,6 +593,7 @@ Sectioned Bibliographies]
}%
\newcommand\bt@change@nat@thb{%
+ \bt@debug{Changing natbib-style thebibliography}%
\def\thebibliography##1{%
\bt@adjust@label{##1}%
\ifthenelse{\not\boolean{bt@printheadings}}{%
@@ -619,6 +649,7 @@ Sectioned Bibliographies]
}
\newcommand*\bt@@harvitem[4][]{%
+ \bt@debug{btharvitem called with args: |#1|#2|#3|#4|}%
\ifthenelse{\equal{#1}{}}{%
\protected@xdef\bt@args{[#2(#3)]}%
}{%
@@ -680,14 +711,14 @@ Sectioned Bibliographies]
\global\let\@noitemerr\relax
\def\cite{%
\@ifstar{}{}% just gobble it
- \@ifnextchar[{% brace matching ]}{
+ \@ifnextchar[{% brace matching }]{
\@citex
}{%
\@citex[]%
}%
}
\def\@citex[##1]{%
- \@ifnextchar[{%]}{
+ \@ifnextchar[{% brace matching }]{
\bt@gobble@citex[##1]%
}{%
\bt@gobble@citex[##1][]%
@@ -711,11 +742,16 @@ Sectioned Bibliographies]
\let\citepalias\cite
\let\jbdoitem\relax
\let\jbbibargs\bt@gobblethree
+ \let\bibnf\relax
+ \let\bibrnf\relax
+ \let\bibenf\relax
+ \let\bibrenf\relax
}
\newcommand*\bt@call@item{}
\ifthenelse{\boolean{bt@fast}}{%
\def\bt@call@item#1{%
+ \bt@debug{bt@call@item called with arg: |#1|}%
\@ifundefined{#1bt@\@extra@b@citeb}{%
\bt@print@all@or@notcited{#1}%
}{%
@@ -724,6 +760,7 @@ Sectioned Bibliographies]
}
}{%
\def\bt@call@item#1{%
+ \bt@debug{bt@call@item called with arg: |#1|}%
\def\endbt@item{\relax}%
\bt@if@elem{#1}{\csname bt@sect\bt@unit@cnt\endcsname}{%
\bt@print@all@or@cited{#1}%
@@ -746,6 +783,7 @@ Sectioned Bibliographies]
}
\newcommand*\bt@print@all@or@notcited[1]{%
\ifthenelse{\boolean{bt@print@cited}}{%
+ \bt@debug{printing cited: #1}%
\bt@dont@print@item
}{%
\bt@do@print@item{#1}%
@@ -777,7 +815,7 @@ Sectioned Bibliographies]
\@percentchar%
\@percentchar%
\@percentchar%
- \space produced automatically by bibtopic.sty v1.0k%
+ \space produced automatically by bibtopic.sty v1.1%
}%
\begingroup
\let\do\@makeother \dospecials
@@ -787,6 +825,7 @@ Sectioned Bibliographies]
\else
\loop
\read\bt@infilea to\bt@tempa
+ \bt@debug{LINE: \bt@tempa}%
% same trick as with \if!...!
\if\ifeof\bt@infilea 0\else 1\fi 1
\immediate\write\bt@outfile{\bt@tempa}%
@@ -855,6 +894,7 @@ Sectioned Bibliographies]
\newif\ifbt@files@diff
\newcommand\bt@line@cnt{}
\newcommand*\bt@if@files@differ[4]{%
+ \bt@debug{comparing #1.aux - #1.bak ...}%
\bt@files@difffalse
\def\bt@line@cnt{0}%
\bgroup
@@ -866,18 +906,23 @@ Sectioned Bibliographies]
\bt@conttrue
\loop
\ifeof\bt@infilea
+ \bt@debug{EOF #1}%
\bt@contfalse
\ifeof\bt@infileb
+ \bt@debug{EOF #2}%
\else
+ \bt@debug{NOT at EOF #1.bak, but EOF #1.aux}%
\global\bt@files@difftrue
\fi
\else
\ifeof\bt@infileb
+ \bt@debug{EOF #1.bak}%
\bt@contfalse
\global\bt@files@difftrue
\fi
\fi
\ifbt@cont
+ \bt@debug{NOT at EOF of both.}%
\read\bt@infilea to\bt@tempa
\read\bt@infileb to\bt@tempb
\bt@stepcnt{\bt@line@cnt}%
@@ -887,7 +932,9 @@ Sectioned Bibliographies]
}{}%
\fi
\ifx\bt@tempa\bt@tempb
+ \bt@debug{\bt@tempa -\bt@tempb\space are equal}%
\else
+ \bt@debug{|\bt@tempa| - |\bt@tempb| differ!}%
\bt@contfalse
\global\bt@files@difftrue
\fi
@@ -903,6 +950,7 @@ Sectioned Bibliographies]
}
\newcommand*\bt@set@cnt[1]{%
+ \bt@debug{setting totalcnt to #1}%
\gdef\bt@totalctr{#1}%
}
@@ -933,8 +981,10 @@ Sectioned Bibliographies]
\bt@get@keyval{#1}{\bt@keyval@list}%
}
\newcommand*\bt@print@keyvals[2]{%
+ \bt@debug{^^J***list is: #1}%
\let\bt@elt\@elt%
\def\@elt##1{%
+ \bt@debug{writing keyval: ##1,#2}%
\protected@write\@auxout{}{%
\string\bt@kv@add{##1}{#2}%
}%
@@ -988,6 +1038,11 @@ Sectioned Bibliographies]
\endcsname\relax
\expandafter\protected@xdef\csname bt@sect%
\bt@unit@cnt\endcsname{\bt@cited@list}%
+ \bt@debug{list\bt@unit@cnt{} newly defined as:
+ \csname bt@sect\bt@unit@cnt\endcsname}%
+ \else
+ \bt@debug{list\bt@unit@cnt{} was already defined as:
+ \csname bt@sect\bt@unit@cnt\endcsname}%
\fi
\stepcounter{btauxfile}%
\bt@info{bibliographystyle is `#1'\MessageBreak
@@ -1040,13 +1095,14 @@ Sectioned Bibliographies]
\string\gdef\string\@extra@binfo{\@extra@b@citeb}}%
\global\bt@inside@unitfalse
}
+\newcommand*\bt@label@sec{\label}%
\newcommand*\btPrintCited{%
\ifthenelse{\boolean{bt@inside@sect}}{%
\protected@edef\bt@curr@line{\the\inputlineno}%
\def\bt@curr@cmd{\string\btPrintCited}%
\bt@stepcnt\bt@internal@sect@cnt%
\bt@print@citedtrue\bt@print@allfalse
- \label{Sec:\bt@internal@sect@cnt}%
+ \bt@label@sec{Sec:\bt@internal@sect@cnt}%
\bt@change@bibitem
\bt@input@or@warn{\thebtauxfile}%
\bt@print@keyvals{\bt@sect@ref@list}{%
@@ -1062,7 +1118,7 @@ Sectioned Bibliographies]
\def\bt@curr@cmd{\string\btPrintNotCited}%
\bt@stepcnt\bt@internal@sect@cnt
\bt@print@citedfalse\bt@print@allfalse
- \label{Sec:\bt@internal@sect@cnt}%
+ \bt@label@sec{Sec:\bt@internal@sect@cnt}%
\bt@change@bibitem
\bt@input@or@warn{\thebtauxfile}%
}{%
@@ -1075,7 +1131,7 @@ Sectioned Bibliographies]
\def\bt@curr@cmd{\string\btPrintAll}%
\bt@stepcnt\bt@internal@sect@cnt
\bt@print@citedfalse\bt@print@alltrue
- \label{Sec:\bt@internal@sect@cnt}%
+ \bt@label@sec{Sec:\bt@internal@sect@cnt}%
\bt@change@bibitem
\bt@input@or@warn{\thebtauxfile}%
\bt@print@keyvals{\bt@sect@ref@list}%