diff options
author | Karl Berry <karl@freefriends.org> | 2020-08-02 21:05:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-08-02 21:05:34 +0000 |
commit | 4cdd4a7d96cd11bcba0ef269aeb917290eebce38 (patch) | |
tree | 78d044213e251230396f2e9db93d0c012e148894 /Master/texmf-dist/tex/latex | |
parent | 8ed53c3af0bd1ec7bd5272c4ff604bd54990fe5f (diff) |
biblatex-publist (2aug20)
git-svn-id: svn://tug.org/texlive/trunk@56028 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx | 173 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx | 4 |
2 files changed, 124 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx index 4c8f91ff625..41843043321 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.17} -\def\bpl@rdate{2020/07/10} +\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)] @@ -378,6 +378,12 @@ \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) @@ -480,8 +486,8 @@ \addspace\bibstring{and}\space} \AtDataInput{% - \indexnames[authorfiltered]{author}% - \indexnames[editorfiltered]{editor}% + \indexnames[authorfiltered][-\value{listtotal}]{author}% + \indexnames[editorfiltered][-\value{listtotal}]{editor}% } \defbibfilter{mine}{category=filtered} @@ -492,30 +498,39 @@ % \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}}% } -\newcounter{nonpleditors} - \DeclareIndexNameFormat{nonpleditorcount}{% \bpl@ifplauthor{\namepartgiven}{\namepartprefix}{\namepartfamily}% - {}% + {\stepcounter{pleditors}}% {\stepcounter{nonpleditors}}% } -\newcounter{nonplauthor} -\newcounter{nonpleditor} \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}% - \indexnames[nonplauthorcount]{author}% - \indexnames[nonpleditorcount]{editor}% + \setcounter{realliststop}{0}% + \indexnames[nonplauthorcount][-\value{listtotal}]{author}% + \indexnames[nonpleditorcount][-\value{listtotal}]{editor}% } % @@ -524,23 +539,66 @@ \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}}% + {\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) - \ifthenelse{\value{listcount}=1}{}{% - \ifnumless{\value{listcount}}{\value{liststop}}% - {\multinamedelim}% - {\finalnamedelim}% - }% + \usebibmacro{bpl:omissiondelim}[#1]% \iftoggle{isplauthor}{% \plauthorhl{% \if@givenfirst% given name first @@ -561,26 +619,29 @@ {\ifdefvoid{\namepartgiven}{}{\addcomma\addspace\namepartgiven\isdot\addspace}}% \fi }% + \ifnumequal{\value{listcount}}{\value{liststop}}{}{\usebibmacro{name:andothers}}% }{% - \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 + \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}% }% - \usebibmacro{name:andothers}% % % Second case: plauthorhandling=omit \else% \if@hlauthor false @@ -606,17 +667,21 @@ \iftoggle{plauthorprecedes}% {}% {% - \ifnumless{\value{nonpl#1}}{\value{nonpl#1s}}% - {\multinamedelim}% - {\printdelim[#1]{bplfinalnamedelim}}% + \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}% @@ -667,7 +732,7 @@ {} {% \usebibmacro{bpl:marginyear}% - \printnames{author}% + \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} @@ -685,7 +750,7 @@ {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}\addspace% - \printnames{author}% + \printnames[][-\value{listtotal}]{author}% \setunit{\addspace}% \iffieldundef{nameaddon} {} @@ -705,12 +770,13 @@ {} {% \usebibmacro{bpl:marginyear}% - \printnames{editor}% - \setunit{\addspace}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% }% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% + \clearname{editor}% \else% \if@hlauthor false \ifnameundef{editor} {} @@ -718,9 +784,10 @@ \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% - \printnames{editor}% - \setunit{\addspace}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% + \clearname{editor}% }% \fi% end of \if@hlauthor else condition } @@ -732,8 +799,8 @@ and not test {\ifnameundef{editor}}} {% \usebibmacro{bpl:marginyear}% - \printnames{editor}% - \setunit{\addcomma\space}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \adddot\addspace% \usebibmacro{bpl:year+labelyear}% @@ -748,8 +815,8 @@ \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \addspace% - \printnames{editor}% - \setunit{\addcomma\space}% + \printnames[][-\value{listtotal}]{editor}% + \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \clearname{editor}% } @@ -758,9 +825,13 @@ } \renewbibmacro*{name:andothers}{% - \ifthenelse{\value{listcount}=\value{liststop}\AND\ifmorenames} + \ifthenelse{\value{listcount}=\value{liststop}\AND\value{liststop}>\value{realliststop}} {% - \ifnum\value{liststop}>1 \finalandcomma\fi + \ifboolexpr{ + test {\ifnumgreater{\value{realliststop}}{1}} + or + test {\iftoggle{plnameafteromission}} + }{\finalandcomma}{}% \andothersdelim\biblcstring{andothers}% } {}% diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.cbx index d70ac4dbf5a..62d0525d23f 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.17} -\def\bpl@rdate{2020/07/10} +\def\bpl@version{1.18} +\def\bpl@rdate{2020/07/31} \ProvidesFile{publist.cbx}[\bpl@rdate\space v.\bpl@version\space biblatex citation style (JSP)] |