% publist.bbx, biblatex bibliography style by Juergen Spitzmueller % requires biblatex >= 3.4 % % 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. % % Please send suggestions and bug reports to % https://github.com/jspitz/biblatex-publist % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \def\bpl@version{1.18} \def\bpl@rdate{2020/07/31} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] \@ifpackagelater{biblatex}{2017/11/04} {} {\PackageError{biblatex-publist} {Outdated 'biblatex' package\MessageBreak Upgrade to biblatex v3.8 (2017/11/04) or later.\MessageBreak I found: '\csuse{ver@biblatex.sty}'.\MessageBreak This is a fatal error. I'm aborting now}% \endinput} % % Bibliography Options and Base Style % % Deprecated Options (as of v. 1.4) \DeclareBibliographyOption{omitname}{% \PackageWarning{biblatex-publist} {The omitname option is deprecated!\MessageBreak Please use plauthorname instead.}{}% \def\bpl@osurname{#1}} \DeclareBibliographyOption{omitfirstname}{% \PackageWarning{biblatex-publist} {The omitfirstname option is deprecated!\MessageBreak Please use plauthorfirstname instead.}{}% \def\bpl@ofirstname{#1}} \DeclareBibliographyOption{omitnameprefix}{% \PackageWarning{biblatex-publist} {The omitnameprefix option is deprecated!\MessageBreak Please use plauthornameprefix instead.}{}% \def\bpl@ovonpart{#1}} % Valid options \DeclareBibliographyOption{plauthorname}{\def\bpl@osurname{#1}} \DeclareBibliographyOption{plauthorfirstname}{\def\bpl@ofirstname{#1}} \DeclareBibliographyOption{plauthornameprefix}{\def\bpl@ovonpart{#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} } \newif\if@hlauthor\@hlauthorfalse \DeclareBibliographyOption{plauthorhandling}[omit]{% \ifstrequal{#1}{highlight}{\@hlauthortrue}{\@hlauthorfalse} } \newif\if@givenfirst\@givenfirstfalse \DeclareBibliographyOption{nameorder}[family-given]{% \ifstrequal{#1}{given-family}{\@givenfirsttrue}{\@givenfirstfalse} } \newtoggle{firstinit} \DeclareBibliographyOption{plauthorfirstinit}[true]{% \ifstrequal{#1}{false}{\togglefalse{firstinit}}{\toggletrue{firstinit}} } \newif\if@bplnumbered\@bplnumberedtrue \DeclareBibliographyOption{plnumbered}[true]{% \ifstrequal{#1}{false}{% 1. "false" \defbibenvironment{bibliography} {\list {} {\setlength{\leftmargin}{\bibhang}% \setlength{\itemindent}{-\leftmargin}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}% } {\endlist} {\item}}{% else: 2. "reset" \ifstrequal{#1}{reset}{% \defbibenvironment{bibliography} {\addtolength{\labelnumberwidth}{\extralabelnumberwidth}% \list {\printtext[labelnumberwidth]{% \printfield{labelprefix}% \printfield{labelnumber}}} {\setlength{\labelwidth}{\labelnumberwidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}}% {\endlist \csnumdef{blx@labelnumber@\the\c@refsection}{0}% } {\item} }{% else: "true" (default: nothing to do here) }% end of clause } } \newtoggle{bpl@linktitle} \newtoggle{bpl@linktitleisbn} \newtoggle{bpl@linktitleissn} \newtoggle{bpl@linktitleurl} \newtoggle{bpl@linktitledoi} \DeclareBibliographyOption{linktitleall}[true]{% \ifstrequal{#1}{true}{ \toggletrue{bpl@linktitleisbn} \toggletrue{bpl@linktitleissn} \toggletrue{bpl@linktitleurl} \toggletrue{bpl@linktitledoi} \toggletrue{bpl@linktitle} }{% \togglefalse{bpl@linktitleisbn} \togglefalse{bpl@linktitleissn} \togglefalse{bpl@linktitleurl} \togglefalse{bpl@linktitledoi} \togglefalse{bpl@linktitle} }% } \DeclareBibliographyOption{linktitleurl}[true]{% \ifstrequal{#1}{true}{% \toggletrue{bpl@linktitleurl} \toggletrue{bpl@linktitle} }{% \togglefalse{bpl@linktitleurl} }% } \DeclareBibliographyOption{linktitledoi}[true]{% \ifstrequal{#1}{true}{% \toggletrue{bpl@linktitledoi} \toggletrue{bpl@linktitle} }{% \togglefalse{bpl@linktitledoi} }% } \DeclareBibliographyOption{linktitleisbn}[true]{% \ifstrequal{#1}{true}{% \toggletrue{bpl@linktitleisbn} \toggletrue{bpl@linktitle} }{% \togglefalse{bpl@linktitleisbn} }% } \DeclareBibliographyOption{linktitleissn}[true]{% \ifstrequal{#1}{true}{% \toggletrue{bpl@linktitleissn} \toggletrue{bpl@linktitle} }{% \togglefalse{bpl@linktitleissn} }% } % Check if users have defined different base styles % If not, use authoryear. \newif\ifbpl@standardbasestyle\bpl@standardbasestylefalse \@ifundefined{publistbasestyle}{% \newcommand*\publistbasestyle{authoryear} \bpl@standardbasestyletrue}{} \RequireBibliographyStyle{\publistbasestyle} \ExecuteBibliographyOptions{% pagetracker=true, labelnumber, useprefix=false, defernumbers=true} % Default sorting depends on plauthorhandling \if@hlauthor% \ExecuteBibliographyOptions{sorting=ydnt} \else \ExecuteBibliographyOptions{sorting=ydt} \fi % Execute these options only with the standard base style \ifbpl@standardbasestyle \ExecuteBibliographyOptions{% maxnames=4, dashed=false} \else % This corresponds to bib option dashed=false % (dashed option is not defined in every style) \providebibmacro*{bbx:savehash}{}% \renewbibmacro*{bbx:savehash}{}% \fi % % Helper functions % % % Removing braces from names (courtesy of egreg at % http://tex.stackexchange.com/a/79583/19291) % and normalize spaces \def\bpl@normalize#1#2{% \begingroup \def\bibnamedelima{ }% \def\bibnamedelimb{ }% \def\IeC##1{##1}% \protected@edef\@tempa{#1}% \gdef\@gtempa{}% \expandafter\bpl@@normalize\@tempa\@nil \endgroup \let#2\@gtempa } \def\bpl@@normalize#1{% \ifx#1\@nil\else \expandafter\gdef\expandafter% \@gtempa\expandafter{\@gtempa#1}% \expandafter\bpl@@normalize \fi } % % Check first token of macro % (based on a suggestion by Qrrbrbirlbel at % https://tex.stackexchange.com/a/132254) \newcommand*{\iffirstinitialsequal}{% \@expandtwoargs\if@startswith} \newcommand*{\if@startswith}[2]{% \if\@car#1.\@nil\@car#2.\@nil \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi } % % Split plauthors list item \def\bpl@lsurname{} \def\bpl@lfirstname{} \def\bpl@lvonpart{} \def\jsp@splitpllist#1{% \begingroup \edef\@tempa{#1}% \expandafter\endgroup \expandafter\jsp@@splitpllist\@tempa\relax% } \def\jsp@@splitpllist#1,#2,#3\relax{% \global\def\bpl@lfirstname{#1}% \global\def\bpl@lvonpart{#2}% \global\def\bpl@lsurname{#3}% } % % Fully expanded comparison % (adapted from scrbase.sty) \newcommand\bpl@ifstreq[2]{% \begingroup\edef\@tempa{#1}\edef\@tempb{#2}% \ifx\@tempa\@tempb \endgroup\expandafter\@firstoftwo \else \endgroup\expandafter\@secondoftwo \fi } % % Check if we have an entry in plauthors % \bpl@ifplauthor{firstname}{prefix}{surname}{true}{false} \newcommand*\bpl@ifplauthor[3]{% \newtoggle{checkplauthor}% \bpl@normalize{#1}{\bpl@tfirstname}% \bpl@normalize{#2}{\bpl@tvonpart}% \bpl@normalize{#3}{\bpl@tsurname}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% % Check if we are dealing with a plauthor % First the plauthorname as set via option \ifboolexpr{ test { \bpl@ifstreq{\bpl@esurname}{\bpl@tsurname} } and ( test { \bpl@ifstreq{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } or ( test { \iftoggle{firstinit} } and test{ \iffirstinitialsequal{\bpl@efirstname}{\bpl@tfirstname} } ) ) and ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\toggletrue{checkplauthor}}{\togglefalse{checkplauthor}}% % Then the name(s) set via macro \def\bpl@lsurname{}% \def\bpl@lfirstname{}% \def\bpl@lvonpart{}% \renewcommand*{\do}[1]{% \jsp@splitpllist{##1}% \bpl@normalize{\bpl@lsurname}{\bpl@elsurname}% \bpl@normalize{\bpl@lfirstname}{\bpl@elfirstname}% \bpl@normalize{\bpl@lvonpart}{\bpl@elvonpart}% \ifboolexpr{ test { \bpl@ifstreq{\bpl@elsurname}{\bpl@tsurname} } and ( test { \bpl@ifstreq{\bpl@elfirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@lfirstname}{} } or ( test { \iftoggle{firstinit} } and test{ \iffirstinitialsequal{\bpl@lfirstname}{\bpl@tfirstname} } ) ) and ( test { \bpl@ifstreq{\bpl@elvonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@lvonpart}{} }) } {\toggletrue{checkplauthor}}{}% }% \dolistloop{\bpl@plauthors}% \iftoggle{checkplauthor}% {\expandafter\@firstoftwo}% {\expandafter\@secondoftwo}% } % % Customization settings % % % The name of the publication list author \def\bpl@osurname{} \def\bpl@ofirstname{} \def\bpl@ovonpart{} % % List to store multiple pl authors (for highlight only) \def\bpl@plauthors{} % % Manual way to specify publication list author(s) name \def\plauthorname{% \@ifnextchar[% {\plauthorname@i} {\plauthorname@i[]}% } \def\plauthorname@i[#1]{% \@ifnextchar[% {\plauthorname@ii{#1}} {\plauthorname@ii{#1}[]}% } \def\plauthorname@ii#1[#2]#3{% \listgadd{\bpl@plauthors}{#1,#2,#3} } % % Formatting of year in margin par (if requested) \providecommand*\plmarginyear[1]{% \raggedleft\small\textbf{#1}% } % % Highlighting auf publist author with plauthorhandling=highlight \providecommand*\plauthorhl[1]{% \mkbibbold{#1}% } % % Field format definitions % \DeclareFieldFormat{bibentrysetcount}{\mkbibparens{\mknumalph{#1}}} \DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}} \DeclareFieldFormat{shorthandwidth}{\mkbibbrackets{#1}} \DeclareFieldFormat{related:parttranslationof}{\mkbibbrackets{#1}} % % Delimiters % % Omission of names in truncated autor list \newcommand*\plnameomission{\bibellipsis\addcomma\addspace} % % Deal with numbering (resume numbers in refsections) % \csnumgdef{bbx@itemtotal}{0} \csnumgdef{bbx@currentitem}{0} \csnumgdef{bbx@saverefsection}{0} \newbool{newsection} \preto\blx@refsection{\global\setbool{newsection}{true}} % Possibility to manually make the space occupied by the label wider \newlength\extralabelnumberwidth \setlength\extralabelnumberwidth{0pt} \defbibenvironment{bibliography} {% \addtolength{\labelnumberwidth}{\extralabelnumberwidth}% \list {\printtext[labelnumberwidth]{% \printfield{labelprefix}% \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 \ifnumgreater{\c@refsection}{\bbx@saverefsection}% {\csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}+\csuse{bbx@currentitem}}}{}% \csnumgdef{bbx@saverefsection}{\c@refsection}% } {\item} \DeclareFieldFormat{labelnumber}{% \ifbool{newsection}{% % Fix start counter value \csnumgdef{bbx@itemtotal}{\csuse{bbx@itemtotal}-#1+1}% \global\setbool{newsection}{false}% }{}% \mkbibdesc{#1}% \csnumgdef{bbx@currentitem}{#1}% } % Print labelnumber as actual number, plus item total \newrobustcmd{\mkbibdesc}[1]{% \number\numexpr\csuse{bbx@itemtotal}+#1\relax% } % Way to manual shift the numbering (undocumented) \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} % % Bibliography filter % % Inspired by http://tex.stackexchange.com/a/28555/19291 % \DeclareBibliographyCategory{filtered} \DeclareIndexNameFormat{authorfiltered}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% {\addtocategory{filtered}{\thefield{entrykey}}}% {}% } \DeclareIndexNameFormat{editorfiltered}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% {\addtocategory{filtered}{\thefield{entrykey}}}% {}% } \DeclareIndexNameFormat[inbook,inproceedings,incollection]{editorfiltered}{}% \DeclareDelimFormat[author]{bplfinalnamedelim}{% \ifnumgreater{\value{nonplauthors}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space} \DeclareDelimFormat[editor]{bplfinalnamedelim}{% \ifnumgreater{\value{nonpleditors}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space} \AtDataInput{% \indexnames[authorfiltered][-\value{listtotal}]{author}% \indexnames[editorfiltered][-\value{listtotal}]{editor}% } \defbibfilter{mine}{category=filtered} % % Count non-plauthors % \newcounter{nonplauthors} \newcounter{nonpleditors} \newcounter{plauthor} \newcounter{pleditor} \newcounter{plauthors} \newcounter{pleditors} \newcounter{realliststop} \newcounter{nonplauthor} \newcounter{nonpleditor} \DeclareIndexNameFormat{nonplauthorcount}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% {\stepcounter{plauthors}} {\stepcounter{nonplauthors}}% } \DeclareIndexNameFormat{nonpleditorcount}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% {\stepcounter{pleditors}}% {\stepcounter{nonpleditors}}% } \AtEveryBibitem{% \setcounter{nonplauthors}{0}% \setcounter{nonpleditors}{0}% \setcounter{plauthor}{0}% \setcounter{pleditor}{0}% \setcounter{plauthors}{0}% \setcounter{pleditors}{0}% \setcounter{nonplauthor}{0}% \setcounter{nonpleditor}{0}% \setcounter{realliststop}{0}% \indexnames[nonplauthorcount][-\value{listtotal}]{author}% \indexnames[nonpleditorcount][-\value{listtotal}]{editor}% } % % Remove or highlight plauthorname in author and editor lists % \newtoggle{plauthorprecedes} \newtoggle{hadplauthor} \newtoggle{isplauthor} \newtoggle{plnameomitted} \newtoggle{plnameafteromission} \newbibmacro*{bpl:omissiondelim}[1][author] {% \ifthenelse{\value{listcount}=1}{\global\togglefalse{plnameafteromission}}{% \ifnumless{\value{listcount}}{\value{liststop}}% {% \ifnumgreater{\value{listcount}}{\value{realliststop}}{% \iftoggle{plnameomitted}{% \multinamedelim\iftoggle{isplauthor}{\plnameomission\global\togglefalse{plnameomitted}% \global\toggletrue{plnameafteromission}}{}% }{% \ifnumless{\value{pl#1}}{\value{pl#1s}}{% \iftoggle{isplauthor} {\multinamedelim\plnameomission\global\togglefalse{plnameomitted}} {\global\toggletrue{plnameomitted}}% }{}% }% }{% \multinamedelim\global\togglefalse{plnameomitted}% }% }{% \ifnumgreater{\value{listcount}}{\value{realliststop}}{% \iftoggle{isplauthor}{\iftoggle{plnameomitted}{\multinamedelim\plnameomission}{}% \finalnamedelim\global\togglefalse{plnameomitted}}{}% }{% \iftoggle{plnameomitted}{% \ifnumequal{\value{listcount}}{\value{liststop}}% {\finalnamedelim} {\multinamedelim\iftoggle{isplauthor}{\global\togglefalse{plnameomitted}}{}}% }{% \ifnumgreater{\value{listcount}}{\value{realliststop}}{% \ifnumgreater{\value{pl#1}}{\value{pl#1s}}{% \iftoggle{isplauthor}{\plnameomission\global\toggletrue{plnameomitted}}% }{}% }{\finalnamedelim}% }% }% }% }% } % Omission/highlighting routine % (common code for authors and editors) % \usebibmacro{bpl:handlenames}[author|editor] \newbibmacro{bpl:handlenames}[1][author]{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% {\global\toggletrue{isplauthor}\stepcounter{pl#1}}% {\global\togglefalse{isplauthor}}% % % Calculate real list stop \ifnumless{\value{liststop}}{\value{maxnames}} {\setcounter{realliststop}{\theliststop}} {\setcounter{realliststop}{\value{minnames}}}% % % First case: plauthorhandling=highlight \if@hlauthor% % Highlight plauthor(s) \usebibmacro{bpl:omissiondelim}[#1]% \iftoggle{isplauthor}{% \plauthorhl{% \if@givenfirst% given name first \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}% {}% {\namepartprefix\addspace}% \namepartfamily% \else% family name first \ifdefvoid{\namepartprefix}% {}% {\namepartprefix\addspace}% \namepartfamily% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% \fi }% \ifnumequal{\value{listcount}}{\value{liststop}}{}{\usebibmacro{name:andothers}}% }{% \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% \if@givenfirst% given name first \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}% {}% {\namepartprefix\addspace}% \namepartfamily% \else% family name first \ifdefvoid{\namepartprefix}% {}% {\namepartprefix\addspace}% \namepartfamily% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% \fi }% \usebibmacro{name:andothers}% }% % % Second case: plauthorhandling=omit \else% \if@hlauthor false \ifthenelse{\value{listcount}=1}% {\ifthenelse{\value{nonpl#1s}>0}% {\bibopenparen\bibstring{with}\addspace}% {}% \iftoggle{isplauthor}% {\global\toggletrue{plauthorprecedes}}% {\global\togglefalse{plauthorprecedes}}% }% {}% % Exclude omitted author \iftoggle{isplauthor}% {% <- TRUE condition \global\toggletrue{hadplauthor}% }% <- end TRUE condition {% <- FALSE condition \stepcounter{nonpl#1}% \ifthenelse{\value{listcount}=1}% {\global\togglefalse{hadplauthor}}% {% \iftoggle{plauthorprecedes}% {}% {% \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% \ifnumless{\value{nonpl#1}}{\value{nonpl#1s}}% {\multinamedelim}% {\printdelim[#1]{bplfinalnamedelim}}% }% }% }% \ifnumgreater{\value{listcount}}{\value{realliststop}}{}{% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \global\togglefalse{plauthorprecedes}% \namepartfamily% }% }% <- end FALSE condition % \usebibmacro{name:andothers}% \ifthenelse{\value{nonpl#1s}>0\AND\value{listcount}=\value{liststop}}% {\unspace\bibcloseparen}% {}% \fi% end of \if@hlauthor else condition } \DeclareNameFormat{author}{% \usebibmacro{bpl:handlenames}% } \DeclareNameFormat{editor}{% \usebibmacro{bpl:handlenames}[editor]% } \DeclareNameFormat{bookauthor}{% \if@givenfirst% given name first \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \namepartfamily% \else% family name first \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \namepartfamily% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% \fi \ifthenelse{\value{listcount}<\value{liststop}} {\ifnumless{\value{listcount}}{\value{liststop}-1}% {\multinamedelim}% {\finalnamedelim}}% {}% \usebibmacro{name:andothers}% } % % Macros % \renewbibmacro*{author}{% \if@hlauthor \ifnameundef{author} {} {% \usebibmacro{bpl:marginyear}% \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} {% \mkbibbrackets{% \bibstring{alias}% \addspace\printfield{nameaddon}% }% }% }% \adddot\addspace\usebibmacro{bpl:year+labelyear}% \else% \if@hlauthor false \ifnameundef{author} {} {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}\addspace% \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} {% \mkbibbrackets{% \bibstring{alias}% \addspace\printfield{nameaddon}% }% }% }% \fi% end of \if@hlauthor else condition } \renewbibmacro*{editor}{% \if@hlauthor \ifnameundef{editor} {} {% \usebibmacro{bpl:marginyear}% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% }% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% \clearname{editor}% \else% \if@hlauthor false \ifnameundef{editor} {} {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% \clearname{editor}% }% \fi% end of \if@hlauthor else condition } \renewbibmacro*{editor+others}{% \if@hlauthor \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}}} {% \usebibmacro{bpl:marginyear}% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% \clearname{editor}% } {}% \else% \if@hlauthor false \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}}} {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \clearname{editor}% } {}% \fi% end of \if@hlauthor else condition } \renewbibmacro*{name:andothers}{% \ifthenelse{\value{listcount}=\value{liststop}\AND\value{liststop}>\value{realliststop}} {% \ifboolexpr{ test {\ifnumgreater{\value{realliststop}}{1}} or test {\iftoggle{plnameafteromission}} }{\finalandcomma}{}% \andothersdelim\biblcstring{andothers}% } {}% } \ifbpl@standardbasestyle % Work around issue in authoryear.bbx: % test for empty year before printing parens \renewbibmacro*{issue+date}{% \ifboolexpr{test {\iffieldundef{year}} and test {\iffieldundef{issue}}} {} {% \printtext[parens]{% \printfield{issue}% \setunit*{\addspace}% \usebibmacro{date}}% }% \newunit% } \fi \newbibmacro*{bpl:date:makedate}{% \printtext{% \iffieldundef{year}{% \iffieldundef{pubstate}% {} {\printfield{pubstate}}% }{% \iffieldundef{month}% {\printdateextra}% {\printdate}% }% }% } \newbibmacro*{bpl:date:labeldate+extradate}{% \mkbibbold{\usebibmacro{bpl:date:makedate}}% } \AtBeginDocument{% \if@unboldyear \renewbibmacro*{bpl:date:labeldate+extradate}{% \usebibmacro{bpl:date:makedate}% } \fi } \newbibmacro*{bpl:marginyear}{% \if@marginyear% \iffieldundef{year}{% \iffieldundef{pubstate}% {}% {\iffieldequals{pubstate}{\bbx@lasthash}% {}% {% \printtext{\marginpar{\small\plmarginyear{\bibsentence\printfield{pubstate}}}}% }% }% }{% \iffieldequals{year}{\bbx@lasthash}% {}% {% \printtext{\marginpar{\small\plmarginyear{\bibsentence\printfield{year}}}}% }% }% \fi } \newbibmacro*{bpl:year+labelyear}{% \iffieldundef{year}{% \iffieldundef{pubstate}% {\let\bbx@lasthash\undefined}% {% \usebibmacro{bpl:date:labeldate+extradate}% \savefield{pubstate}{\bbx@lasthash}% \clearfield{pubstate}% }% }{% \usebibmacro{bpl:date:labeldate+extradate}% \savefield{year}{\bbx@lasthash}% \clearfield{year}% }% } \newbibmacro*{bpl:review:author/label}{% \ifnameundef{author} {\usebibmacro{label}} {\usebibmacro{bpl:review:author}} } \newbibmacro*{bpl:review:author}{% \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{bpl:review:year+labelyear}% } \newbibmacro*{bpl:review:year+labelyear}{% \iffieldundef{year} {} {% \printtext[parens]{% \printfield{labelyear}% \printfield{extradate}% }% }% } % % l7n % \NewBibliographyString{with} \NewBibliographyString{parttranslationof} \DefineBibliographyStrings{english}{% parttranslationof = {partial translation of}, with = {with} } \DefineBibliographyStrings{french}{% parttranslationof = {traduction partielle de}, with = {avec} } \DefineBibliographyStrings{german}{% parttranslationof = {Teil\"ubersetzung von}, with = {mit} } % % New driver for reviews % \DeclareBibliographyDriver{review}{% \usebibmacro{bpl:review:author/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}% } % % Sorting schemes % % Consider the whole date (year-month-day) % Sorting date (descending), name, title \DeclareSortingTemplate{ddnt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort[direction=descending]{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort[direction=descending]{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort[direction=descending]{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sortname} \field{author} \field{editor} \field{translator} \field{sorttitle} \field{title} } \sort{ \field{sorttitle} \field{title} } } % Sorting year (descending), month, day, name, title \DeclareSortingTemplate{ydmdnt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort[direction=descending]{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sortname} \field{author} \field{editor} \field{translator} \field{sorttitle} \field{title} } \sort{ \field{sorttitle} \field{title} } } % Sorting date (ascending), name, title \DeclareSortingTemplate{dnt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sortname} \field{author} \field{editor} \field{translator} \field{sorttitle} \field{title} } \sort{ \field{sorttitle} \field{title} } } % Sorting schemes without name % Sorting year (descending), title \DeclareSortingTemplate{ydt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort[direction=descending]{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort{ \field{sorttitle} \field{title} } } % Consider the whole date (year-month-day) % Sorting date (descending), title \DeclareSortingTemplate{ddt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort[direction=descending]{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort[direction=descending]{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort[direction=descending]{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sorttitle} \field{title} } } % Sorting year (descending), month, day, title \DeclareSortingTemplate{ydmdt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort[direction=descending]{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sorttitle} \field{title} } } % Sorting date (ascending), title \DeclareSortingTemplate{dt}{ \sort{ \field{presort} } \sort[final]{ \field{sortkey} } \sort{ \field[strside=left,strwidth=4]{sortyear} \field[strside=left,strwidth=4]{year} \literal{9999} } \sort{ \field[padside=left,padwidth=2,padchar=0]{month} \literal{00} } \sort{ \field[padside=left,padwidth=2,padchar=0]{day} \literal{00} } \sort{ \field{sorttitle} \field{title} } } % Define bibmacro that applies a hypertext reference % Inspired by https://tex.stackexchange.com/a/48506/19291 \newbibmacro*{bpl:linked}[1]{% \ifboolexpr{ test {\ifhyperref} and not test {\ifentrytype{online}} } {\iffieldundef{doi} {\iffieldundef{url} {\iffieldundef{isbn} {\iffieldundef{issn} {#1} {\iftoggle{bpl@linktitleissn}{\href{\plissnlink{\thefield{issn}}}{#1}}{#1}}} {\iftoggle{bpl@linktitleisbn}{\href{\plisbnlink{\thefield{isbn}}}{#1}}{#1}}} {\iftoggle{bpl@linktitleurl}{\href{\thefield{url}}{#1}}{#1}}} {\iftoggle{bpl@linktitledoi}{\href{https://doi.org/\thefield{doi}}{#1}}{#1}}} {#1}% } % URL for ISBN/ISSN queries \newcommand*\plisbnlink[1]{https://www.worldcat.org/search?qt=worldcat_org_all&q=#1} \newcommand*\plissnlink[1]{https://www.worldcat.org/search?qt=worldcat_org_all&q=#1} % % Mappings (biber) % % Add a dummy constant shortauthor in order to % ignore author constellation on extralabel assignment. \if@hlauthor \else \DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite]{ \step[fieldset=shortauthor, fieldvalue={1111}] } } } \fi % Correctly sort pubstates. \DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map{ \step[fieldsource=year, final] \step[fieldset=sortyear, origfieldval] } \map{ \step[fieldsource=pubstate, match=\regexp{forthcoming}, final] \step[fieldset=sortyear, fieldvalue={2222}] } \map{ \step[fieldsource=pubstate, match=\regexp{inpress}, final] \step[fieldset=sortyear, fieldvalue={3333}] } \map{ \step[fieldsource=pubstate, match=\regexp{submitted}, final] \step[fieldset=sortyear, fieldvalue={4444}] } \map{ \step[fieldsource=pubstate, match=\regexp{inpreparation}, final] \step[fieldset=sortyear, fieldvalue={5555}] } } } % Link titles if so requested \AtBeginDocument{% \iftoggle{bpl@linktitle}{% \DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite=true]{ \step[fieldsource=title, match=\regexp{(.*)}, replace=\regexp{\\usebibmacro{bpl:linked}{$1}}, final=true] } \map[overwrite=true]{ \step[fieldsource=subtitle, match=\regexp{(.*)}, replace=\regexp{\\usebibmacro{bpl:linked}{$1}}, final=true] } } } }{} } % % Deprecated stuff % % DEPRECATED as of v.1.4 % Issue a warning if used. \newtoggle{bpl:omitname} \def\omitname{% \toggletrue{bpl:omitname}% \@ifnextchar[% {\plauthorname@i} {\plauthorname@i[]}% } \AtEndPreamble{% \iftoggle{bpl:omitname}{% \PackageWarning{biblatex-publist}% {The \protect\omitname\space macro is deprecated!\MessageBreak Please use \protect\plauthorname\space instead.}{}% }% } \endinput