From daaeaf2b27cf6fd1376b8a0ab96409972fb5d58c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 22 Oct 2012 23:27:48 +0000 Subject: new biblatex-publist (22oct12) git-svn-id: svn://tug.org/texlive/trunk@28050 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/biblatex-publist/publist.bbx | 335 +++++++++++++++++++++ 1 file changed, 335 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx (limited to 'Master/texmf-dist/tex/latex/biblatex-publist') diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx new file mode 100644 index 00000000000..52053b744ce --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx @@ -0,0 +1,335 @@ +% publist.bbx, biblatex style by Juergen Spitzmueller +% requires biblatex >= 1.7 +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2003/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This Current Maintainer of this work is Jürgen Spitzmüller. +% +% This work consists of the file publist.bbx +% +% +% The purpose of this file is to provide a biblatex bibliography style +% for (numbered) publication lists where the own name is omitted and +% co-authors are marked as such. +% +% This is work in progress. Please send suggestions and bug reports +% to +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\ProvidesFile{publist.bbx}[2012/10/21 v0.2 biblatex bibliography style] + +\@ifpackagelater{biblatex}{2011/11/13} + {} + {\PackageError{biblatex-publist} + {Outdated 'biblatex' package\MessageBreak + Upgrade to biblatex v1.7 (2011/11/13) or later.\MessageBreak + I found: '\csuse{ver@biblatex.sty}'.\MessageBreak + This is a fatal error. I'm aborting now}% + \endinput} + +\RequireBibliographyStyle{authoryear} + +\ExecuteBibliographyOptions{% + pagetracker=spread, + labelnumber, + useprefix=false, + dashed=false, + sorting=ydnt, + defernumbers=true, + maxnames=99} + +% +% The omitted name of the publication list author +\providecommand*\mysurname{} +\providecommand*\myfirstname{} +% +% Formatting of year in margin par (if requested) +\providecommand*\plmarginyear[1]{% + \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} +} + + +\DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}} +\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}} +\DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} +\DeclareFieldFormat{related:parttranslationof}{\mkbibbrackets{#1}} + + +% +% Deal with numbering (resume numbers in refsections) +% +\csnumgdef{bbx@itemtotal}{0} +\csnumgdef{bbx@currentitem}{0} + +\defbibenvironment{bibliography} + {\list + {\printtext[labelnumberwidth]{% + \printfield{prefixnumber}% + \printfield{labelnumber}}} + {\setlength{\labelwidth}{\labelnumberwidth}% + \setlength{\leftmargin}{\labelwidth}% + \setlength{\labelsep}{\biblabelsep}% + \addtolength{\leftmargin}{\labelsep}% + \setlength{\itemsep}{\bibitemsep}% + \setlength{\parsep}{\bibparsep}}% + \renewcommand*{\makelabel}[1]{\hss##1}} + {\endlist\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}+\csuse{bbx@currentitem}}} + {\item} + +\DeclareFieldFormat{labelnumber}{\mkbibdesc{#1}\csnumgdef{bbx@currentitem}{#1}} +\DeclareFieldFormat[reference]{labelnumber}{#1} + +% Print labelnumber as actual number, plus item total +\newrobustcmd{\mkbibdesc}[1]{% + \number\numexpr\csuse{bbx@itemtotal}+#1\relax} + +\newcommand*\decreasebbxnumbering[1]{\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}-#1}} + + +% +% New environment for (foreign) reviews +% +\defbibenvironment{reviews} + {\begin{enumerate}% + \small\setlength\itemsep{0pt}} + {\end{enumerate}} + {\item} + + +% +% Remove own name from author and editor lists +% +\newtoggle{ismyself} +\newtoggle{hadmyself} + +\DeclareNameFormat{author}{% + \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{author}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% + % Exclude omitted author + \ifboolexpr{ + 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}}% + }% + }% + \ifblank{#3}{}{#3\addspace}% + \ifblank{#5}{}{#5\addspace}% + \togglefalse{ismyself}% + #1% + \usebibmacro{name:andothers}}% + \ifthenelse{\value{listcount}=\value{liststop}\AND\value{author}>1}{\unspace\bibcloseparen}{}% +} + +\DeclareNameFormat{editor}{% + \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{editor}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% + % Exclude omitted author + \ifboolexpr{ + 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}}% + }% + }% + \ifblank{#3}{}{#3\addspace}% + \ifblank{#5}{}{#5\addspace}% + \togglefalse{ismyself}% + #1% + \usebibmacro{name:andothers}}% + \ifthenelse{\value{listcount}=\value{liststop}\AND\value{editor}>1}{\unspace\bibcloseparen}{}% +} + +\DeclareNameFormat{bookauthor}{% + \ifblank{#5}{}{#5\addspace}% + #1\ifblank{#3}{}{\addcomma\space #3} + \ifthenelse{\value{listcount}<\value{liststop}} + {\addslash} + {}% + \usebibmacro{name:andothers}} + +\renewbibmacro*{name:andothers}{% + \ifthenelse{\value{listcount}=\value{liststop}\AND + \ifmorenames} + {\ifnum\value{liststop}>1 \finalandcomma\fi + \andothersdelim\biblcstring{andothers}} + {}} + +% +% Macros +% + +\renewbibmacro*{author}{% + \ifnameundef{author} + {} + {\usebibmacro{year+labelyear}\addspace% + \printnames{author}% + \setunit{\addspace}% + \iffieldundef{nameaddon} + {} + {\mkbibbrackets{\bibstring{alias}% + \addspace\printfield{nameaddon}}}}} + +\renewbibmacro*{editor}{% + \ifnameundef{editor} + {} + {\usebibmacro{year+labelyear}% + \addspace% + \printnames{editor}% + \setunit{\addspace}% + \usebibmacro{editorstrg}}} + +\renewbibmacro*{editor+others}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}} + } + {\usebibmacro{year+labelyear}% + \addspace% + \printnames{editor}% + \setunit{\addcomma\space}% + \usebibmacro{editor+othersstrg}% + \clearname{editor}} + {}} + +\newbibmacro*{labelyear+extrayear}{% + \mkbibbold{\printtext{% + \printfield{labelyear}% + \printfield{extrayear}}}% +} + +\AtBeginDocument{% +\if@unboldyear +\renewbibmacro*{labelyear+extrayear}{% + \printtext{% + \printfield{labelyear}% + \printfield{extrayear}}% +} +\fi +} + +\newbibmacro*{year+labelyear}{% + \iffieldundef{year} + {\let\bbx@lasthash\undefined} + {\usebibmacro{labelyear+extrayear}% + \if@marginyear + \iffieldequals{labelyear}{\bbx@lasthash}{}{% + \printtext{\marginpar{\small\plmarginyear{\printfield{labelyear}}}}% + }% + \fi + \savefield{labelyear}{\bbx@lasthash}% + }} + +\newbibmacro*{rauthor/label}{% + \ifnameundef{author} + {\usebibmacro{label}} + {\usebibmacro{rauthor}} +} + +\newbibmacro*{rauthor}{% + \ifnameundef{author} + {\let\bbx@lasthash\undefined} + {\ifthenelse{\iffieldequals{namehash}{\bbx@lasthash}\AND\NOT + \iffirstonpage} + {\bibnamedash} + {\savefield{namehash}{\bbx@lasthash}% + \printnames{author}% + \setunit{\addspace}}}% + \iffieldundef{nameaddon} + {} + {\mkbibbrackets{\bibstring[\unspace]{alias}\addspace\printfield{nameaddon}}% + \addspace}% + \usebibmacro{ryear+labelyear}} + +\newbibmacro*{ryear+labelyear}{% + \iffieldundef{year} + {} + {\printtext[parens]{% + \printfield{labelyear}% + \printfield{extrayear}}}} + +% +% l7n +% +\NewBibliographyString{with} +\NewBibliographyString{parttranslationof} +\DefineBibliographyStrings{ngerman}{% + parttranslationof = {Teil\"ubersetzung von}, + with = {mit} +} +\DefineBibliographyStrings{english}{% + parttranslationof = {partial translation of}, + with = {with} +} + + +% +% New driver for reviews +% + +\DeclareBibliographyDriver{review}{% + \usebibmacro{rauthor/label}% + \setunit*{\addcolon\space}% + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{in:}% + \usebibmacro{journal+issuetitle}% + \newunit\newblock + \printfield{note}% + \setunit{\addcomma\space}% + \printfield{pages} + \newunit\newblock + \printfield{issn}% + \newunit\newblock + \printfield{doi}% + \setunit{\addspace} + \usebibmacro{addendum+pubstate}% + \newunit\newblock + \usebibmacro{url+urldate}% + \newunit\newblock + \usebibmacro{pageref}% + \newunit\newblock + \usebibmacro{related}% + \usebibmacro{finentry}} + +\endinput -- cgit v1.2.3