% 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.11} \def\bpl@rdate{2018/09/01} \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} } \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 } } % 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, sorting=ydnt, defernumbers=true} % 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 % % Customization settings % % % The name of the publication list author \def\bpl@osurname{} \def\bpl@ofirstname{} \def\bpl@ovonpart{} % % Manual way to specify publication list author 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{% % Do stuff \def\bpl@osurname{#3} \ifx\@empty#1\else\def\bpl@ofirstname{#1}\fi \ifx\@empty#2\else\def\bpl@ovonpart{#2}\fi } % % 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}} % % 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} % % Helper function: % 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 } % % Bibliography filter % % Inspired by http://tex.stackexchange.com/a/28555/19291 \DeclareBibliographyCategory{filtered} \DeclareIndexNameFormat{authorfiltered}{% \bpl@normalize{\namepartfamily}{\bpl@tsurname}% \bpl@normalize{\namepartgiven}{\bpl@tfirstname}% \bpl@normalize{\namepartprefix}{\bpl@tvonpart}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} \DeclareIndexNameFormat{editorfiltered}{% \edef\bpl@tsurname{\namepartfamily}% \edef\bpl@tfirstname{\namepartgiven}% \edef\bpl@tvonpart{\namepartprefix}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\addtocategory{filtered}{\thefield{entrykey}}} {}} \DeclareIndexNameFormat[inbook,inproceedings,incollection]{editorfiltered}{}% \AtDataInput{% \indexnames[authorfiltered]{author}% \indexnames[editorfiltered]{editor}% } \defbibfilter{mine}{category=filtered} % % Remove or embolden omitted name in author and editor lists % \newtoggle{myselfprec} \newtoggle{hadmyself} \newtoggle{ismyself} \DeclareNameFormat{author}{% \if@hlauthor% % Embolden omitted author \bpl@normalize{\namepartfamily}{\bpl@tsurname}% \bpl@normalize{\namepartgiven}{\bpl@tfirstname}% \bpl@normalize{\namepartprefix}{\bpl@tvonpart}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\toggletrue{ismyself}}{\togglefalse{ismyself}}% \ifthenelse{\value{listcount}=1}{}{% \ifnumless{\value{listcount}}{\value{liststop}}% {\multinamedelim}% {\finalnamedelim}% }% \iftoggle{ismyself}{\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\addspace}}% \fi }}{% \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\addspace}}% \fi }% \usebibmacro{name:andothers}% \else% \if@hlauthor false \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{author}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% % Exclude omitted author \bpl@normalize{\namepartfamily}{\bpl@tsurname}% \bpl@normalize{\namepartgiven}{\bpl@tfirstname}% \bpl@normalize{\namepartprefix}{\bpl@tvonpart}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \bpl@normalize{\bpl@ovonpart}{\bpl@evonpart}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\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}% {\multinamedelim}% {\iftoggle{hadmyself}{% \ifnumless{\value{listcount}}{\value{liststop}}% {\multinamedelim}% {\finalnamedelim}} {\finalnamedelim}}% }% }% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \togglefalse{myselfprec}% \namepartfamily}% \usebibmacro{name:andothers}% \ifthenelse{\value{listcount}=\value{liststop}\AND\value{author}>1}{\unspace\bibcloseparen}{}% \fi% end of \if@hlauthor else condition } \DeclareNameFormat{editor}{% \if@hlauthor % Embolden omitted editor \bpl@normalize{\namepartfamily}{\bpl@tsurname}% \bpl@normalize{\namepartgiven}{\bpl@tfirstname}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\toggletrue{ismyself}}{\togglefalse{ismyself}} \ifthenelse{\value{listcount}=1}{}{% \ifnumless{\value{listcount}}{\value{liststop}-1}% {\multinamedelim}% {\finalnamedelim}% }% \iftoggle{ismyself}{\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\addspace}}% \fi }}{% \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\addspace}}% \fi }% \usebibmacro{name:andothers}% \else% \if@hlauthor false \ifthenelse{\value{listcount}=1}{\ifthenelse{\value{editor}>1}{\bibopenparen\bibstring{with}\addspace}{}}{}% % Exclude omitted author \bpl@normalize{\namepartfamily}{\bpl@tsurname}% \bpl@normalize{\namepartgiven}{\bpl@tfirstname}% \bpl@normalize{\bpl@osurname}{\bpl@esurname}% \bpl@normalize{\bpl@ofirstname}{\bpl@efirstname}% \ifboolexpr{ test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } and ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} }) and ( test { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } {\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}% {\multinamedelim}% {\iftoggle{hadmyself}{% \ifnumless{\value{listcount}}{\value{liststop}}% {\multinamedelim}% {\finalnamedelim}} {\finalnamedelim}}% }% }% \ifgiveninits {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% \togglefalse{myselfprec}% \namepartfamily}% \usebibmacro{name:andothers}% \ifthenelse{\value{listcount}=\value{liststop}\AND\value{editor}>1}{\unspace\bibcloseparen}{}% \fi% end of \if@hlauthor else condition } \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\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{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{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{editor}% \setunit{\addspace}% \usebibmacro{editorstrg}} \adddot\addspace% \usebibmacro{bpl:year+labelyear}% \else% \if@hlauthor false \ifnameundef{editor} {} {\usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% \printnames{editor}% \setunit{\addspace}% \usebibmacro{editorstrg}} \fi% end of \if@hlauthor else condition } \renewbibmacro*{editor+others}{% \if@hlauthor \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}} } {\usebibmacro{bpl:marginyear}% \printnames{editor}% \setunit{\addcomma\space}% \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{editor}% \setunit{\addcomma\space}% \usebibmacro{editor+othersstrg}% \clearname{editor}} {}% \fi% end of \if@hlauthor else condition } \renewbibmacro*{name:andothers}{% \ifthenelse{\value{listcount}=\value{liststop}\AND \ifmorenames} {\ifnum\value{liststop}>1 \finalandcomma\fi \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} } } % % Mappings (biber) % % 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}] } } } % % 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