From b4568bc71e054f3d1fd6404b45d2322631778284 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 22 Feb 2019 23:11:46 +0000 Subject: biblatex-publist (22feb19) git-svn-id: svn://tug.org/texlive/trunk@50085 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/biblatex-publist/publist.bbx | 696 ++++++++++++++------- .../tex/latex/biblatex-publist/publist.cbx | 4 +- 2 files changed, 481 insertions(+), 219 deletions(-) (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 index 4b61d0bfaa1..8370a95a202 100644 --- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx @@ -25,8 +25,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{1.13} -\def\bpl@rdate{2018/11/30} +\def\bpl@version{1.15} +\def\bpl@rdate{2019/02/22} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -159,6 +159,73 @@ \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 +} + + % % Customization settings % @@ -169,6 +236,9 @@ \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 name \def\plauthorname{% \@ifnextchar[% @@ -181,10 +251,7 @@ {\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 + \listgadd{\bpl@plauthors}{#1,#2,#3} } % @@ -271,46 +338,11 @@ {\item} -% -% 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 -} - - % % Bibliography filter % % Inspired by http://tex.stackexchange.com/a/28555/19291 +% \DeclareBibliographyCategory{filtered} \DeclareIndexNameFormat{authorfiltered}{% @@ -320,16 +352,40 @@ \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 { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } + test { \bpl@ifstreq{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\addtocategory{filtered}{\thefield{entrykey}}} - {}} + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}}% + {}% + % 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}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}}% + {}% + }% + \dolistloop{\bpl@plauthors}% +} \DeclareIndexNameFormat{editorfiltered}{% \edef\bpl@tsurname{\namepartfamily}% @@ -338,21 +394,49 @@ \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 { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } + test { \bpl@ifstreq{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\addtocategory{filtered}{\thefield{entrykey}}} - {}} + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}}% + {}% + % 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}{} }) } + {\addtocategory{filtered}{\thefield{entrykey}}}% + {}% + }% + \dolistloop{\bpl@plauthors}% +} \DeclareIndexNameFormat[inbook,inproceedings,incollection]{editorfiltered}{}% \DeclareDelimFormat{bplfinalnamedelim}{% - \ifnumgreater{\value{liststop}}{3}{\finalandcomma}{}% + \ifnumgreater{\value{nonplauthors}}{2}{\finalandcomma}{}% + \addspace\bibstring{and}\space} + +\DeclareDelimFormat{bplfinalnamedelimed}{% + \ifnumgreater{\value{nonpleditors}}{2}{\finalandcomma}{}% \addspace\bibstring{and}\space} \AtDataInput{% @@ -362,204 +446,382 @@ \defbibfilter{mine}{category=filtered} + % -% Remove or embolden omitted name in author and editor lists +% Count non-plauthors % -\newtoggle{myselfprec} -\newtoggle{hadmyself} -\newtoggle{ismyself} -\DeclareNameFormat{author}{% - \if@hlauthor% - % Embolden omitted author + +\newcounter{nonplauthors} + +\DeclareIndexNameFormat{nonplauthorcount}{% + \newtoggle{havenonplauthor}% + \toggletrue{havenonplauthor}% \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}% + % Check if we are dealing with a plauthor + % First the plauthorname as set via option \ifboolexpr{ - test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } + test { \bpl@ifstreq{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } - or ( test { \iftoggle{firstinit} } and test{ \iffirstinitialsequal{\bpl@efirstname}{\bpl@tfirstname} } ) + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\global\toggletrue{ismyself}}{\global\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\isdot\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\isdot\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}% + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\togglefalse{havenonplauthor}}% + {}% + % 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}{} }) } + {\togglefalse{havenonplauthor}}% + {}% + }% + \dolistloop{\bpl@plauthors}% + \iftoggle{havenonplauthor}{\stepcounter{nonplauthors}}{}% +} + +\newcounter{nonpleditors} + +\DeclareIndexNameFormat{nonpleditorcount}{% + \newtoggle{havenonplauthor}% + \toggletrue{havenonplauthor}% + \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}% + % Check if we are dealing with a plauthor + % First the plauthorname as set via option \ifboolexpr{ - test { \ifdefstrequal{\bpl@esurname}{\bpl@tsurname} } + test { \bpl@ifstreq{\bpl@esurname}{\bpl@tsurname} } and - ( test { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\global\toggletrue{myselfprec}\global\toggletrue{hadmyself}% - \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} - {\stepcounter{liststop}}{}} - {\ifthenelse{\value{listcount}=1}{\global\togglefalse{hadmyself}}{% - \ifboolexpr{ - test { \iftoggle{myselfprec} } + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\togglefalse{havenonplauthor}}% + {}% + % 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 { \ifnumless{\value{listcount}}{3} } } - {}{% - \ifnumless{\value{listcount}}{\value{liststop}-1}% - {\multinamedelim}% - {\iftoggle{hadmyself}{% - \ifnumless{\value{listcount}}{\value{liststop}}% - {\multinamedelim}% - {\bplfinalnamedelim}} - {\bplfinalnamedelim}}% - }% - }% - \ifgiveninits - {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% - {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% - \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% - \global\togglefalse{myselfprec}% - \namepartfamily}% - \usebibmacro{name:andothers}% - \ifthenelse{\value{listcount}=\value{liststop}\AND\value{author}>1}{\unspace\bibcloseparen}{}% - \fi% end of \if@hlauthor else condition + ( 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}{} }) } + {\togglefalse{havenonplauthor}}% + {}% + }% + \dolistloop{\bpl@plauthors}% + \iftoggle{havenonplauthor}{\stepcounter{nonpleditors}}{}% } -\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} } +\newcounter{nonplauthor} +\newcounter{nonpleditor} +\AtEveryBibitem{% + \setcounter{nonplauthors}{0}% + \setcounter{nonpleditors}{0}% + \setcounter{nonplauthor}{0}% + \setcounter{nonpleditor}{0}% + \indexnames[nonplauthorcount]{author}% + \indexnames[nonpleditorcount]{editor}% +} + +% +% Remove or highlight plauthorname in author and editor lists +% +\newtoggle{plauthorprecedes} +\newtoggle{hadplauthor} +\newtoggle{isplauthor} + + +\DeclareNameFormat{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}% + % 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 { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } - or ( test { \iftoggle{firstinit} } and test{ \iffirstinitialsequal{\bpl@efirstname}{\bpl@tfirstname} } ) + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\global\toggletrue{ismyself}}{\global\togglefalse{ismyself}} + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\global\toggletrue{isplauthor}}{\global\togglefalse{isplauthor}}% + % 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}{} }) } + {\global\toggletrue{isplauthor}}{}% + }% + \dolistloop{\bpl@plauthors}% + % + % First case: plauthorhandling=highlight + \if@hlauthor% + % Highlight plauthor(s) \ifthenelse{\value{listcount}=1}{}{% - \ifnumless{\value{listcount}}{\value{liststop}-1}% - {\multinamedelim}% - {\finalnamedelim}% + \ifnumless{\value{listcount}}{\value{liststop}}% + {\multinamedelim}% + {\finalnamedelim}% }% - \iftoggle{ismyself}{\plauthorhl{% + \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 + }% + }{% \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 - }}{% - \if@givenfirst% given name first - \ifgiveninits - {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% - {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% - \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% - \namepartfamily% + \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 + \ifdefvoid{\namepartprefix}% + {}% + {\namepartprefix\addspace}% + \namepartfamily% + \ifgiveninits + {\ifdefvoid{\namepartgiveni}{}{\addcomma\addspace\namepartgiveni\addspace}}% + {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\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} } + % + % Second case: plauthorhandling=omit + \else% \if@hlauthor false + \ifthenelse{\value{listcount}=1}% + {\ifthenelse{\value{nonplauthors}>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{nonplauthor}% + \ifthenelse{\value{listcount}=1}% + {\global\togglefalse{hadplauthor}}% + {% + \iftoggle{plauthorprecedes}% + {}% + {% + \ifnumless{\value{nonplauthor}}{\value{nonplauthors}}% + {\multinamedelim}% + {\bplfinalnamedelim}% + }% + }% + \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{nonplauthors}>0\AND\value{listcount}=\value{liststop}}{\unspace\bibcloseparen}{}% + \fi% end of \if@hlauthor else condition +} + +\DeclareNameFormat{editor}{% + \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}% + % 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 { \ifdefstrequal{\bpl@efirstname}{\bpl@tfirstname} } or test { \ifdefstring{\bpl@ofirstname}{} } - or ( test { \iftoggle{firstinit} } and test{ \iffirstinitialsequal{\bpl@efirstname}{\bpl@tfirstname} } ) + ( 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 { \ifdefstrequal{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } - {\global\toggletrue{myselfprec}\global\toggletrue{hadmyself}% - \ifthenelse{\value{listcount}=1\AND\value{liststop}=1} - {\stepcounter{liststop}}{}} - {\ifthenelse{\value{listcount}=1}{\global\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}% - {\bplfinalnamedelim}} - {\bplfinalnamedelim}}% - }% + ( test { \bpl@ifstreq{\bpl@evonpart}{\bpl@tvonpart} } or test { \ifdefstring{\bpl@ovonpart}{} }) } + {\global\toggletrue{isplauthor}}{\global\togglefalse{isplauthor}}% + % 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}{} }) } + {\global\toggletrue{isplauthor}}{}% + }% + \dolistloop{\bpl@plauthors}% + % + % First case: plauthorhandling=highlight + \if@hlauthor + % Highlight omitted editor + \ifthenelse{\value{listcount}=1}{}{% + \ifnumless{\value{listcount}}{\value{liststop}-1}% + {\multinamedelim}% + {\finalnamedelim}% + }% + \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 }% - \ifgiveninits - {\ifdefvoid{\namepartgiveni}{}{\namepartgiveni\addspace}}% - {\ifdefvoid{\namepartgiven}{}{\namepartgiven\addspace}}% - \ifdefvoid{\namepartprefix}{}{\namepartprefix\addspace}% - \global\togglefalse{myselfprec}% - \namepartfamily}% - \usebibmacro{name:andothers}% - \ifthenelse{\value{listcount}=\value{liststop}\AND\value{editor}>1}{\unspace\bibcloseparen}{}% - \fi% end of \if@hlauthor else condition + }{% + \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{nonpleditors}>0}% + {\bibopenparen\bibstring{with}\addspace}% + {}% + \iftoggle{isplauthor}% + {\global\toggletrue{plauthorprecedes}}% + {\global\togglefalse{plauthorprecedes}}% + }% + {}% + % Exclude omitted editor + \iftoggle{isplauthor}% + {% <- TRUE condition + \global\toggletrue{hadplauthor}% + }% <- end TRUE condition + {% <- FALSE condition + \stepcounter{nonpleditor}% + \ifthenelse{\value{listcount}=1}% + {\global\togglefalse{hadplauthor}}% + {% + \iftoggle{plauthorprecedes}% + {}% + {% + \ifnumless{\value{nonpleditor}}{\value{nonpleditors}}% + {\multinamedelim}% + {\bplfinalnamedelimed}% + }% + }% + \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{nonpleditors}>0\AND\value{listcount}=\value{liststop}}{\unspace\bibcloseparen}{}% + \fi% end of \if@hlauthor else condition } \DeclareNameFormat{bookauthor}{% @@ -1045,7 +1307,7 @@ % ignore author constellation on extralabel assignment. \if@hlauthor \else -\DeclareSourcemap{ +\DeclareStyleSourcemap{ \maps[datatype=bibtex]{ \map[overwrite]{ \step[fieldset=shortauthor, fieldvalue={1111}] diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx index a2a20dcfa26..4313e0a20dd 100644 --- a/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx @@ -26,8 +26,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{1.13} -\def\bpl@rdate{2018/11/30} +\def\bpl@version{1.15} +\def\bpl@rdate{2019/02/22} \ProvidesFile{publist.cbx}[\bpl@rdate\space v.\bpl@version\space biblatex citation style (JSP)] -- cgit v1.2.3