diff options
author | Karl Berry <karl@freefriends.org> | 2012-10-23 23:30:42 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-10-23 23:30:42 +0000 |
commit | 96c2f6d58f41753e3a725cd10e4ff646155e9017 (patch) | |
tree | 5b0ca0aca5ba23b0fce7f053731a898a384b49b6 /Master/texmf-dist/tex/latex/biblatex-publist | |
parent | 16bf9ff0d2574baf1055949532b3ac27c9e0c46b (diff) |
biblatex-publist (23oct12)
git-svn-id: svn://tug.org/texlive/trunk@28061 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-publist')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx | 144 |
1 files changed, 105 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx index 52053b744ce..147cac98f4d 100644 --- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx @@ -1,5 +1,5 @@ % publist.bbx, biblatex style by Juergen Spitzmueller -% requires biblatex >= 1.7 +% requires biblatex >= 2.0 % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -25,13 +25,17 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\ProvidesFile{publist.bbx}[2012/10/21 v0.2 biblatex bibliography style] +\def\bpl@version{0.3} +\def\bpl@rdate{2012/10/21} -\@ifpackagelater{biblatex}{2011/11/13} +\ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space + biblatex bibliography style (JSP)] + +\@ifpackagelater{biblatex}{2012/07/01} {} {\PackageError{biblatex-publist} {Outdated 'biblatex' package\MessageBreak - Upgrade to biblatex v1.7 (2011/11/13) or later.\MessageBreak + Upgrade to biblatex v2.0 (2012/07/01) or later.\MessageBreak I found: '\csuse{ver@biblatex.sty}'.\MessageBreak This is a fatal error. I'm aborting now}% \endinput} @@ -45,7 +49,7 @@ dashed=false, sorting=ydnt, defernumbers=true, - maxnames=99} + maxnames=4} % % The omitted name of the publication list author @@ -57,21 +61,28 @@ \raggedleft\small\textbf{#1}% } + % % Options % \DeclareBibliographyOption{omitname}{\renewcommand*\mysurname{#1}} + \DeclareBibliographyOption{omitfirstname}{\renewcommand*\myfirstname{#1}} + \newif\if@marginyear\@marginyearfalse \DeclareBibliographyOption{marginyear}[true]{% \ifstrequal{#1}{true}{\@marginyeartrue\reversemarginpar}{\@marginyearfalse} } + \newif\if@unboldyear\@unboldyearfalse \DeclareBibliographyOption{boldyear}[true]{% \ifstrequal{#1}{false}{\@unboldyeartrue}{\@unboldyearfalse} } +% +% Field format definitions +% \DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}} \DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}} \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} @@ -83,6 +94,7 @@ % \csnumgdef{bbx@itemtotal}{0} \csnumgdef{bbx@currentitem}{0} +\newbool{started} \defbibenvironment{bibliography} {\list @@ -99,8 +111,14 @@ {\endlist\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}+\csuse{bbx@currentitem}}} {\item} -\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}\csnumgdef{bbx@currentitem}{#1}} -\DeclareFieldFormat[reference]{labelnumber}{#1} +\DeclareFieldFormat{labelnumber}{% + \ifbool{started}{}{% + % Assure we really start at 0. + \csnumgdef{bbx@itemtotal}{-#1+1}% + \global\setbool{started}{true}}% + \mkbibdesc{#1}% + \csnumgdef{bbx@currentitem}{#1}% +} % Print labelnumber as actual number, plus item total \newrobustcmd{\mkbibdesc}[1]{% @@ -120,9 +138,41 @@ % +% Filtered category +% +% Inspired by http://tex.stackexchange.com/a/28555/19291 +\DeclareBibliographyCategory{filtered} + +\DeclareIndexNameFormat{authorfiltered}{% + \ifboolexpr{ + test { \ifdefstring{\mysurname}{#1} } + and + ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}} + {}} + +\DeclareIndexNameFormat{editorfiltered}{% + \ifboolexpr{ + test { \ifdefstring{\mysurname}{#1} } + and + ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}} + {}} + +\DeclareIndexNameFormat[inbook,inproceedings,incollection]{editorfiltered}{}% + +\AtDataInput{% + \indexnames[authorfiltered]{author}% + \indexnames[editorfiltered]{editor}% +} + +\defbibfilter{mine}{category=filtered} + + +% % Remove own name from author and editor lists % -\newtoggle{ismyself} +\newtoggle{myselfprec} \newtoggle{hadmyself} \DeclareNameFormat{author}{% @@ -132,23 +182,29 @@ test { \ifdefstring{\mysurname}{#1} } and ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } - {\toggletrue{ismyself}\toggletrue{hadmyself}} + {\toggletrue{myselfprec}\toggletrue{hadmyself}% + \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} + {\stepcounter{liststop}}{}} {\ifthenelse{\value{listcount}=1}{\togglefalse{hadmyself}}{% - \iftoggle{ismyself}{}{% - \ifnumless{\value{listcount}}{\value{liststop}-1}% - {\addcomma\addspace}% - {\iftoggle{hadmyself}{% - \ifnumless{\value{listcount}}{\value{liststop}}% - {\addcomma\addspace}% - {\addspace\bibstring{and}\addspace}} - {\addspace\bibstring{and}\addspace}}% - }% + \ifboolexpr{ + test { \iftoggle{myselfprec} } + and + test { \ifnumless{\value{listcount}}{3} } } + {}{% + \ifnumless{\value{listcount}}{\value{liststop}-1}% + {\addcomma\addspace}% + {\iftoggle{hadmyself}{% + \ifnumless{\value{listcount}}{\value{liststop}}% + {\addcomma\addspace}% + {\addspace\bibstring{and}\addspace}} + {\addspace\bibstring{and}\addspace}}% + }% }% \ifblank{#3}{}{#3\addspace}% \ifblank{#5}{}{#5\addspace}% - \togglefalse{ismyself}% - #1% - \usebibmacro{name:andothers}}% + \togglefalse{myselfprec}% + #1}% + \usebibmacro{name:andothers}% \ifthenelse{\value{listcount}=\value{liststop}\AND\value{author}>1}{\unspace\bibcloseparen}{}% } @@ -159,23 +215,29 @@ test { \ifdefstring{\mysurname}{#1} } and ( test { \ifdefstring{\myfirstname}{#3} } or test { \ifdefstring{\myfirstname}{} }) } - {\toggletrue{ismyself}\toggletrue{hadmyself}} - {\ifthenelse{\value{listcount}=1}{\togglefalse{hadmyself}} - {\iftoggle{ismyself}{}{% - \ifnumless{\value{listcount}}{\value{liststop}-1}% - {\addcomma\addspace}% - {\iftoggle{hadmyself}{% - \ifnumless{\value{listcount}}{\value{liststop}}% - {\addcomma\addspace}% - {\addspace\bibstring{and}\addspace}} - {\addspace\bibstring{and}\addspace}}% - }% + {\toggletrue{myselfprec}\toggletrue{hadmyself}% + \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} + {\stepcounter{liststop}}{}} + {\ifthenelse{\value{listcount}=1}{\togglefalse{hadmyself}}{% + \ifboolexpr{ + test { \iftoggle{myselfprec} } + and + test { \ifnumless{\value{listcount}}{3} } } + {}{% + \ifnumless{\value{listcount}}{\value{liststop}-1}% + {\addcomma\addspace}% + {\iftoggle{hadmyself}{% + \ifnumless{\value{listcount}}{\value{liststop}}% + {\addcomma\addspace}% + {\addspace\bibstring{and}\addspace}} + {\addspace\bibstring{and}\addspace}}% + }% }% \ifblank{#3}{}{#3\addspace}% \ifblank{#5}{}{#5\addspace}% - \togglefalse{ismyself}% - #1% - \usebibmacro{name:andothers}}% + \togglefalse{myselfprec}% + #1}% + \usebibmacro{name:andothers}% \ifthenelse{\value{listcount}=\value{liststop}\AND\value{editor}>1}{\unspace\bibcloseparen}{}% } @@ -293,14 +355,18 @@ % \NewBibliographyString{with} \NewBibliographyString{parttranslationof} -\DefineBibliographyStrings{ngerman}{% - parttranslationof = {Teil\"ubersetzung von}, - with = {mit} -} \DefineBibliographyStrings{english}{% parttranslationof = {partial translation of}, with = {with} } +\DefineBibliographyStrings{french}{% + parttranslationof = {traduction partielle de}, + with = {avec} +} +\DefineBibliographyStrings{german}{% + parttranslationof = {Teil\"ubersetzung von}, + with = {mit} +} % |