diff options
author | Karl Berry <karl@freefriends.org> | 2011-03-16 22:15:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-03-16 22:15:37 +0000 |
commit | d34bf77a2d4ca330856db5dce536f6f65345b2d4 (patch) | |
tree | 5cdc5e41ec50be2e693ece37435231cb4107f2cc /Master/texmf-dist/tex/latex/biblatex/biblatex.sty | |
parent | ae6ef6b688e802ee3a36dde35e801dd71cc982a5 (diff) |
biblatex 1.3 (15mar11)
git-svn-id: svn://tug.org/texlive/trunk@21736 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/biblatex.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex/biblatex.sty | 209 |
1 files changed, 156 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/biblatex.sty b/Master/texmf-dist/tex/latex/biblatex/biblatex.sty index fb6d3810573..ee938a6b7cf 100644 --- a/Master/texmf-dist/tex/latex/biblatex/biblatex.sty +++ b/Master/texmf-dist/tex/latex/biblatex/biblatex.sty @@ -1,4 +1,4 @@ -% $Id: biblatex.sty,v 1.2a 2011/02/13 12:05:37 lehman stable $ +% $Id: biblatex.sty,v 1.3 2011/03/14 18:25:44 lehman stable $ % Copyright (c) 2006-2011 Philipp Lehman. % @@ -21,11 +21,11 @@ \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{biblatex} -[\abx@rcsid $Id: biblatex.sty,v 1.2a 2011/02/13 12:05:37 lehman stable $ +[\abx@rcsid $Id: biblatex.sty,v 1.3 2011/03/14 18:25:44 lehman stable $ programmable bibliographies] \def\blx@bblversion$#1: #2 ${#2} -\edef\blx@bblversion{\blx@bblversion$Revision: 1.2 $} +\edef\blx@bblversion{\blx@bblversion$Revision: 1.3 $} %% Dependencies @@ -124,9 +124,8 @@ \toggletrue{blx@tempa}% \def\do#1{% \patchcmd#1% - {\interlinepenalty\interfootnotelinepenalty} - {\toggletrue{blx@footnote}% - \interlinepenalty\interfootnotelinepenalty} + {\color@begingroup} + {\color@begingroup\toggletrue{blx@footnote}} {\togglefalse{blx@tempa}\listbreak} {}}% \docsvlist{% @@ -137,16 +136,16 @@ \l@dold@footnotetext,% ledmac \l@doldold@footnotetext,% ledmac \@fntORI}% frenchle + \def\do#1{% + \patchcmd#1% + {\color@begingroup} + {\color@begingroup\toggletrue{blx@footnote}} + {} + {}}% \@ifclassloaded{memoir}% memoir - {\togglefalse{blx@tempa}% - \def\do#1{% - \patchcmd#1% - {\color@begingroup} - {\color@begingroup\toggletrue{blx@footnote}} - {} - {\toggletrue{blx@tempa}}}% - \docsvlist{% + {\docsvlist{% \m@mold@footnotetext,% + \@plainfootnotetext,% \@twocolfootnotetext,% \@threecolfootnotetext,% \@parafootnotetext}} @@ -315,6 +314,10 @@ \def\themaxitems{\the\c@maxitems} \newcounter{minitems} \def\theminitems{\the\c@minitems} +\newcounter{citecounter} +\def\thecitecount{\the\c@citecounter} +\newcounter{savedcitecounter} +\def\thecitecount{\the\c@savedcitecounter} \newcounter{uniquename} \def\theuniquename{\the\c@uniquename} \newcounter{saveduniquename} @@ -395,7 +398,7 @@ \newtoggle{blx@mcite} \newtoggle{blx@loadfiles} \newtoggle{blx@singletitle} -\newtoggle{blx@terseinits} +\newtoggle{blx@terseinits}% BibTeX only \newtoggle{blx@firstinits} \newtoggle{blx@useauthor} \newtoggle{blx@useeditor} @@ -3409,11 +3412,18 @@ \fi}% \def\currentname{#3}% \letcs\blx@thedata{abx@name@#3}% - \let~\abx@btxnbspacefix + \ifnumequal\blx@backend\blx@backend@biber + {} + {\let~\bibnamedelima}% \blx@namecodes} -\protected\def\abx@btxnbspacefix{% - \leavevmode\penalty\value{highnamepenalty}\space} +\newrobustcmd*{\bibinitperiod}{\adddot} +\newrobustcmd*{\bibinitdelim}{\addnbspace} +\newrobustcmd*{\bibinithyphendelim}{.\mbox{-}} +\newrobustcmd*{\bibnamedelima}{\addhighpenspace} +\newrobustcmd*{\bibnamedelimb}{\addlowpenspace} +\newrobustcmd*{\bibnamedelimc}{\addhighpenspace} +\newrobustcmd*{\bibnamedelimd}{\addlowpenspace} % [<format>][<start>-<stop>]{<namelist>} @@ -4746,6 +4756,7 @@ \def\do##1{\togglefalse{abx@bool@##1}}% \abx@dobooleans \c@uniquename\z@ + \c@citecounter\z@ \let\do\blx@saved@do} \protected\def\blx@saveentry{% @@ -4759,6 +4770,7 @@ \let\do\blx@savebool \abx@dobooleans \c@saveduniquename\c@uniquename + \c@savedcitecounter\c@citecounter \let\do\blx@saved@do} \protected\def\blx@savename#1{% @@ -5072,7 +5084,8 @@ \ifcsdef{blx@data@\the\c@refsection @#1}} \def\blx@getdata#1{% - \csuse{blx@data@\the\c@refsection @#1}} + \csuse{blx@data@\the\c@refsection @#1}% + \blx@setcitecounter} \def\blx@getdata@cite#1{% \ifcsdef{blx@setc@\the\c@refsection @#1} @@ -6458,10 +6471,7 @@ \def\blx@refsection{% \begingroup - \let\do\@makeother - \dospecials - \catcode`\{=\@ne - \catcode`\}=\tw@ + \blx@hook@fileverb \blx@refsection@i} \def\blx@refsection@i[#1]{% @@ -6637,15 +6647,15 @@ \def\blx@tempa{file}% \def\blx@tempb{bibtex}% \def\blx@tempc{local}% - \forcsvlist\blx@addbib@legacy{#1}% + \blx@xsanitizeafter{\forcsvlist\blx@addbib@legacy}{#1}% \endgroup} \@onlypreamble\bibliography \def\blx@addbib@legacy#1{% \begingroup - \blx@xsanitizeafter{\def\blx@tempa}{\blx@stripbib{#1}\detokenize{.bib}} - \edef\blx@tempb{\endgroup\noexpand\blx@addbib@resource{\blx@tempa}}% - \blx@tempb} + \edef\blx@tempa{\endgroup + \noexpand\blx@addbib@resource{\blx@stripbib{#1}\detokenize{.bib}}}% + \blx@tempa} \def\blx@stripbib#1{% \expandafter\blx@stripbib@i\detokenize{#1.bib}&} @@ -6674,10 +6684,7 @@ \def\blx@addbib@i#1[#2]{% \begingroup - \let\do\@makeother - \dospecials - \catcode`\{=\@ne - \catcode`\}=\tw@ + \blx@hook@fileverb \blx@addbib@ii{#1}{#2}} \def\blx@addbib@ii#1#2#3{% @@ -6691,6 +6698,13 @@ \blx@xsanitizeafter{#1}{#3}% \endgroup} +\def\blx@hook@fileverb{% + \let\do\@makeother + \dospecials + \catcode`\\=\z@ + \catcode`\{=\@ne + \catcode`\}=\tw@} + \define@key{blx@addbib}{type}{\def\blx@tempa{#1}} \define@key{blx@addbib}{datatype}{\def\blx@tempb{#1}} \define@key{blx@addbib}{location}{\def\blx@tempc{#1}} @@ -6989,6 +7003,7 @@ \csuse{blx@hook@citekey@next}% \blx@execute \blx@loopcode + \blx@citecounter \blx@citetracker \blx@ibidtracker \blx@idemtracker @@ -7000,6 +7015,54 @@ \fi \endgroup} +% cite counter + +\def\blx@citecounter@global{% + \ifbool{@filesw} + {\ifbool{citetracker} + {\immediate\write\@mainaux{% + \string\abx@aux@count + {\the\c@refsection}{\abx@field@entrykey}}} + {}} + {}} + +\def\blx@citecounter@context{% + \ifbool{@filesw} + {\ifbool{citetracker} + {\immediate\write\@mainaux{% + \iftoggle{blx@footnote} + {\string\abx@aux@fncount} + {\string\abx@aux@count}% + {\the\c@refsection}{\abx@field@entrykey}}} + {}} + {}} + +% {<refsection>}{<entrykey>} + +\protected\def\blx@aux@count#1#2{% + \csnumgdef{blx@count@#1@\detokenize{#2}}{\csuse{blx@count@#1@\detokenize{#2}}+1}} +\protected\def\blx@aux@fncount#1#2{% + \csnumgdef{blx@fncount@#1@\detokenize{#2}}{\csuse{blx@fncount@#1@\detokenize{#2}}+1}} + +\let\abx@aux@count\@gobbletwo +\let\abx@aux@fncount\@gobbletwo + +\AtEndDocument{% + \let\abx@aux@count\@gobbletwo + \let\abx@aux@fncount\@gobbletwo} + +\protected\def\blx@setcitecounter@global{% + \c@citecounter0% + \csuse{blx@count@\the\c@refsection @\abx@field@entrykey}% + \relax} + +\protected\def\blx@setcitecounter@context{% + \c@citecounter0% + \iftoggle{blx@footnote} + {\csuse{blx@fncount@\the\c@refsection @\abx@field@entrykey}} + {\csuse{blx@count@\the\c@refsection @\abx@field@entrykey}}% + \relax} + % cite tracker \def\blx@citetracker@global{% @@ -7578,9 +7641,9 @@ \def\blx@defcitecmd@i#1#2{% \blx@checkcitecmd{#2}{#1}% - \protected\csedef{#2}{% + \protected\csdef{#2}{% \blx@citecmdinit - \noexpand\@ifstar + \@ifstar {\blx@citepunct{\blxcitecmd{#2*}}} {\blx@citepunct{\blxcitecmd{#2}}}}% \@ifnextchar[%] @@ -7815,9 +7878,11 @@ \csedef{blx@acitei@#1}##1##2##3##4##5{% \begingroup \blx@citeinit - \if l#2\unspace##5\fi + \if l#2\noexpand\unspace##5\fi + \if f#2\noexpand\iffootnote{}{\unspace##5}\fi \blxcitecmd{#3##1}{##2}{##3}{##4}{}% \if r#2##5\fi + \if f#2\noexpand\iffootnote{##5}{}\fi \endgroup}% \protected\csedef{blx@macite@#1}{% \blx@citecmdinit @@ -7831,9 +7896,11 @@ \expandafter\noexpand \csname blx@macitei@#1\endcsname}}% \csedef{blx@macitei@#1}##1##2##3{% - \if l#2\unspace##3\fi + \if l#2\noexpand\unspace##3\fi + \if f#2\noexpand\iffootnote{}{\unspace##3}\fi ##1{##2}% \if r#2##3\fi + \if f#2\noexpand\iffootnote{##3}{}\fi \endgroup}} % {<characters>} @@ -7945,6 +8012,8 @@ \let\blx@cite@footcite\relax \newrobustcmd*{\footcitetext}{\blx@warn@citecmd\footcitetext\cite} \let\blx@cite@footcitetext\relax +\newrobustcmd*{\smartcite}{\blx@warn@citecmd\smartcite\cite} +\let\blx@cite@smartcite\relax \newrobustcmd*{\textcite}{\blx@warn@citecmd\textcite\cite} \let\blx@cite@textcite\relax \newrobustcmd*{\supercite}{\blx@warn@citecmd\supercite\cite} @@ -8247,7 +8316,7 @@ \newrobustcmd{\blx@mkbibfootnote}[2]{% \iftoggle{blx@footnote} {\blx@warning{Nested notes}% - \addspace\mkbibparens{#1}} + \addspace\mkbibparens{#2}} {\unspace \ifnum\blx@notetype=\tw@ \expandafter\@firstoftwo @@ -8262,7 +8331,7 @@ \newrobustcmd{\blx@mkbibendnote}[2]{% \iftoggle{blx@footnote} {\blx@warning{Nested notes}% - \addspace\mkbibparens{#1}} + \addspace\mkbibparens{#2}} {\unspace \ifnum\blx@notetype=\@ne \expandafter\@firstoftwo @@ -8468,7 +8537,6 @@ \blx@xml@toggle{singletitle}% \blx@xml@svalue{sortalphaothers}{\sortalphaothers}% \blx@xml@svalue{sortlos}{\blx@sortlos}% - \blx@xml@toggle{terseinits}% \blx@xml@svalue{uniquename}{\blx@uniquename}% \blx@xml@toggle{useauthor}% \blx@xml@toggle{useeditor}% @@ -8922,10 +8990,19 @@ {\def\blx@texencoding{#1}}} \DeclareBibliographyOption{bibencoding}{% - \ifstrequal{#1}{inputenc} - {\def\blx@bibencoding{auto}} + \ifcsdef{blx@inpenc@#1} + {\letcs\blx@bibencoding{blx@bibenc@#1}} {\def\blx@bibencoding{#1}}} +\def\abx@mapbibenc#1#2{\csdef{blx@bibenc@#1}{#2}} +\abx@mapbibenc{inputenc}{auto} +\abx@mapbibenc{x-ascii}{ascii} + +\def\abx@mapinpenc#1#2{\csdef{blx@inpenc@#1}{#2}} +\abx@mapinpenc{utf8x}{utf8} +\abx@mapinpenc{lutf8}{utf8} +\abx@mapinpenc{x-ascii}{ascii} + \DeclareBibliographyOption{safeinputenc}[true]{% \settoggle{blx@safeinputenc}{#1}} \newtoggle{blx@safeinputenc} @@ -9059,8 +9136,16 @@ \fi} \DeclareBibliographyOption{terseinits}[true]{% - \settoggle{blx@terseinits}{#1}} - + \ifstrequal{#1}{true} + {\toggletrue{blx@terseinits}% BibTeX only + \renewrobustcmd*{\bibinitperiod}{} + \renewrobustcmd*{\bibinitdelim}{} + \renewrobustcmd*{\bibinithyphendelim}{}} + {\togglefalse{blx@terseinits}% BibTeX only + \renewrobustcmd*{\bibinitperiod}{\adddot} + \renewrobustcmd*{\bibinitdelim}{\addnbspace} + \renewrobustcmd*{\bibinithyphendelim}{\adddot\mbox{-}}}} + \DeclareBibliographyOption{firstinits}[true]{% \settoggle{blx@firstinits}{#1}} @@ -9239,6 +9324,28 @@ \blx@opt@pagetracker@page \fi} +\DeclareBibliographyOption{citecounter}[true]{% + \ifcsdef{blx@opt@citecounter@#1} + {\csuse{blx@opt@citecounter@#1}} + {\blx@err@invopt{citecounter=#1}{}}} +\def\blx@opt@citecounter@true{% + \let\blx@setcitecounter\blx@setcitecounter@global + \let\blx@citecounter\blx@citecounter@global + \let\abx@aux@count\blx@aux@count + \let\abx@aux@fncount\blx@aux@fncount + \booltrue{citetracker}} +\def\blx@opt@citecounter@context{% + \let\blx@setcitecounter\blx@setcitecounter@context + \let\blx@citecounter\blx@citecounter@context + \let\abx@aux@count\blx@aux@count + \let\abx@aux@fncount\blx@aux@fncount + \booltrue{citetracker}} +\def\blx@opt@citecounter@false{% + \let\blx@setcitecounter\relax + \let\blx@citecounter\relax + \let\abx@aux@count\@gobbletwo + \let\abx@aux@fncount\@gobbletwo} + \DeclareBibliographyOption{citetracker}[true]{% \ifcsdef{blx@opt@citetracker@#1} {\csuse{blx@opt@citetracker@#1}} @@ -9624,10 +9731,11 @@ usetranslator=false,indexing=false,abbreviate=true,dateabbrev=true, backref=false,backrefsetstyle=setonly,pagetracker=false,ibidtracker=false, idemtracker=false,opcittracker=false,loccittracker=false,citetracker=false, - block=none,language=auto,clearlang=true,babel=none,date=comp,origdate=comp, - eventdate=comp,urldate=short,autopunct=true,punctfont=false,defernumbers=false, - refsection=none,refsegment=none,citereset=none,hyperref=auto, - parentracker,maxparens=3,maxline=79,bibencoding=auto,bibwarn} + citecounter=false,block=none,language=auto,clearlang=true,babel=none, + date=comp,origdate=comp,eventdate=comp,urldate=short,autopunct=true, + punctfont=false,defernumbers=false,refsection=none,refsegment=none, + citereset=none,hyperref=auto,parentracker,maxparens=3,maxline=79, + bibencoding=auto,bibwarn} % Load compatibility code @@ -9762,11 +9870,6 @@ \fi \blx@checkencoding} -\def\abx@mapinpenc#1#2{\csdef{blx@enc@#1}{#2}} -\abx@mapinpenc{utf8x}{utf8} -\abx@mapinpenc{lutf8}{utf8} -\abx@mapinpenc{x-ascii}{ascii} - \def\blx@checkencoding{% \ifdef\blx@texencoding {\blx@info@noline{% @@ -9786,8 +9889,8 @@ \blx@info@noline{% XeTeX detected.\MessageBreak Assuming input encoding '\blx@texencoding'}}} - {\ifcsdef{blx@enc@\inputencodingname} - {\letcs\blx@texencoding{blx@enc@\inputencodingname}} + {\ifcsdef{blx@inpenc@\inputencodingname} + {\letcs\blx@texencoding{blx@inpenc@\inputencodingname}} {\let\blx@texencoding\inputencodingname}% \blx@info@noline{% Input encoding '\blx@texencoding' detected}}}% |