diff options
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx')
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx | 301 |
1 files changed, 228 insertions, 73 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx index c7d385b452..d3f31a7a03 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-publist/publist.bbx @@ -25,8 +25,8 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\bpl@version{2.9} -\def\bpl@rdate{2025/05/09} +\def\bpl@version{2.13} +\def\bpl@rdate{2024/08/21} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -61,13 +61,14 @@ \newtoggle{bpl@linktitleissn} \newtoggle{bpl@linktitleurl} \newtoggle{bpl@linktitledoi} +\newtoggle{bpl@citinfo} \newtoggle{bpl@jifinfo} \newtoggle{bpl@prinfo} \toggletrue{bpl@prinfo} \newtoggle{bpl@oainfo} \newtoggle{bpl@oainfosimple} \newif\if@bpl@reversenum\@bpl@reversenumfalse - +\def\bpl@annots{} % Valid options % @@ -188,6 +189,9 @@ }, plnumbering.default:n = { global }, plnumbering.usage:n = preamble, + % annotations=<csv> + % Store author name prefix + annotations.tl_set:N = \bpl@annots, % linktitles=<all|url|doi|isbn|issn|none> linktitles .multichoice:, % Link all titles @@ -233,6 +237,18 @@ \toggletrue{bpl@linktitle} }, linktitles.default:n = { all }, + % citinfo=<true|false> + % Information about citation numbers + citinfo.code:n = + { + \str_if_eq:nnTF { #1 } { true } + { + \toggletrue{bpl@citinfo} + }{ + \togglefalse{bpl@citinfo} + } + }, + citinfo.default:n = { true }, % jifinfo=<true|false> % Impact factor information jifinfo.code:n = @@ -428,6 +444,7 @@ \DeclareBibliographyOption{plauthorhandling}[omit]{\ExecutePublistOptions{plauthorhandling=#1}} \DeclareBibliographyOption{nameorder}[family-given]{\ExecutePublistOptions{nameorder=#1}} \DeclareBibliographyOption{plsorting}[ydt]{\ExecutePublistOptions{plsorting=#1}} +\DeclareBibliographyOption{annotations}{\ExecutePublistOptions{annotations={#1}}} \DeclareBibliographyOption{plnumbering}[global]{\ExecutePublistOptions{plnumbering=#1}} \DeclareBibliographyOption{marginyear}[true]{\ExecutePublistOptions{marginyear=#1}} @@ -437,6 +454,7 @@ \DeclareBibliographyOption{jifinfo}[true]{\ExecutePublistOptions{jifinfo=#1}} \DeclareBibliographyOption{oainfo}[simple]{\ExecutePublistOptions{oainfo=#1}} \DeclareBibliographyOption{prinfo}[true]{\ExecutePublistOptions{prinfo=#1}} +\DeclareBibliographyOption{citinfo}[true]{\ExecutePublistOptions{citinfo=#1}} \DeclareBibliographyOption{linktitles}[all]{\ExecutePublistOptions{linktitles={#1}}}% Extra braces needed (multichoice) @@ -552,16 +570,31 @@ {}{\PackageWarning{biblatex-publist}{Patching refsection failed!}} }{} -\newcommand*\GetSectionCount[1][\empty]{% - \edef\bpl@secno{#1}% - \ifx\bpl@secno\empty% - \csnumdef{bpltmprefsection}{\c@refsection}% - \csuse{bpl@secitems:\bpltmprefsection}% - \else% - \csuse{bpl@secitems:#1}% - \fi% +% Section count. We use l3 here to split the argument and do calculations +\ExplSyntaxOn + +\int_new:N \l_bpl_sec_cnt_int + +\NewDocumentCommand \GetSectionCount { >{\SplitList{,}} o } +{ + \IfNoValueTF{#1}{% + \csnumdef{bpltmprefsection}{\c@refsection} + \ifcsdef{bpl@secitems:\bpltmprefsection}{\csuse{bpl@secitems:\bpltmprefsection}}{}% + }{ + \int_zero:N \l_bpl_sec_cnt_int + \ProcessList{#1}{\__bpl_add_section_count} + \int_use:N \l_bpl_sec_cnt_int + } +} + +\cs_new:Npn \__bpl_add_section_count #1 +{ + \cs_if_exist:cT {bpl@secitems:#1} + { \int_add:Nn \l_bpl_sec_cnt_int { \use:c{bpl@secitems:#1} } } } +\ExplSyntaxOff + \newcommand*\GetTotalCount{% \csuse{bpl@items}% } @@ -897,7 +930,15 @@ \newrobustcmd{\mkbibdesc}[1]{% % Print labelnumber as actual number, plus item total - \number\numexpr\csuse{bpl@itemtotal}+#1+\csuse{bpl@shift@itemtotal}\relax% + \edef\bpl@current@item@no{\number\numexpr\csuse{bpl@itemtotal}+#1+\csuse{bpl@shift@itemtotal}\relax}% + \bpl@current@item@no% + % Store number in pbx file + \if@filesw% + \protected@write\bpl@bpxfile{}{% + \csedef{bpl@itemnumber:\thefield{entrykey}}{\bpl@current@item@no}% + \csedef{bpl@itemsec:\thefield{entrykey}}{\therefsection}% + }% + \fi% }% % Way to manually shift the numbering @@ -963,23 +1004,37 @@ % Print the labelnumber as the total number of entries in the % current refsection, minus the actual labelnumber, plus one \ifbool{plnumgroup}{% - \number\numexpr\csuse{bpl@itemtotal}-#1+1\relax% + \xdef\bpl@current@item@no{\number\numexpr\csuse{bpl@itemtotal}-#1+1\relax}% + \bpl@current@item@no% }{% \ifcsdef{bpl@secitems:\therefsection}{% - \number\numexpr\csuse{bpl@secitems:\therefsection}-#1+1% - +\csuse{bpl@shift@itemtotal}\relax% + \xdef\bpl@current@item@no{\number\numexpr\csuse{bpl@secitems:\therefsection}-#1+1% + +\csuse{bpl@shift@itemtotal}\relax}% + \bpl@current@item@no% }{% - \number\numexpr\csuse{bpl@itemtotal}-#1+1\relax% + \xdef\bpl@current@item@no{\number\numexpr\csuse{bpl@itemtotal}-#1+1\relax}% + \bpl@current@item@no% }% }% }{% % Use decreasing counter \ifcsdef{bpl@items:\theprevrefsection}{% - \number\numexpr\csuse{bpl@itemtotal}-#1+1-\csuse{bpl@items:\theprevrefsection}\relax% + \xdef\bpl@current@item@no{\number\numexpr\csuse{bpl@itemtotal}-#1+1% + -\csuse{bpl@items:\theprevrefsection}\relax}% + \bpl@current@item@no% }{% - \number\numexpr\csuse{bpl@itemtotal}-#1+1\relax% + \xdef\bpl@current@item@no{\number\numexpr\csuse{bpl@itemtotal}-#1+1\relax}% + \bpl@current@item@no% }% }% + % Store number in pbx file + \if@filesw% + \protected@write\bpl@bpxfile{}{% + \csedef{bpl@itemnumber:\thefield{entrykey}}{\bpl@current@item@no}% + \csedef{bpl@itemsec:\thefield{entrykey}}{\therefsection}% + \csedef{bpl@itemtotal}{\csuse{bpl@itemtotal}}% + }% + \fi% }% \renewrobustcmd{\mkbibsecstart}[1]{% \setcounter{prevrefsection}{\therefsection}% @@ -1014,6 +1069,64 @@ \fi }% +% +% Data annotation +% + +\newcommand*\mkbplannot[1]{\textsuperscript{#1}} + +% Symbol helpers +\ExplSyntaxOn + \clist_new:N \l_bpl_annot_symbols + \cs_new_nopar:Npn \SetAnnotSymbols #1 + { + \clist_gset:Nn \l_bpl_annot_symbols { #1 } + } + \SetAnnotSymbols + { \textasteriskcentered, \textdaggerdbl, \textsection, \textparagraph, + \textbardbl, \textdagger, {\textasteriskcentered\textasteriskcentered}, + {\textdaggerdbl\textdaggerdbl}, {\textdagger\textdagger} + } + % get symbol by position (int) + \cs_new_nopar:Npn \bpl@get@annot@symbol #1 + { + \clist_item:Nn \l_bpl_annot_symbols { #1 } + } +\ExplSyntaxOff + +% get symbol by category name +\NewDocumentCommand\GetAnnotSymbol { s m }{ + \edef\tmpa{}% + \setcounter{annotsymb}{1}% + \renewcommand*{\do}[1]{% + \ifstrequal{#2}{##1} + {\edef\tmpa{\bpl@get@annot@symbol{\theannotsymb}}}% + {}% + \stepcounter{annotsymb}% + }% + \expandafter\docsvlist\expandafter{\bpl@annots}% + \IfBooleanTF{#1}{\tmpa}{\mkbplannot{\tmpa}}% +} + +% handle the annotations as passed by annotations option +\AtEndOfPackage{% +\ifx\bpl@annots\empty\else + % helper function for annotations + \newcounter{annotsymb} + \newcommand*\bplannot{% + \setcounter{annotsymb}{1}% + \renewcommand*{\do}[1]{% + \ifitemannotation{##1} + {\mkbplannot{\bpl@get@annot@symbol{\theannotsymb}}}% + {}% + \stepcounter{annotsymb}% + }% + \expandafter\docsvlist\expandafter{\bpl@annots}% + } + % do annotation in family names + \renewcommand*{\mkbibnamefamily}[1]{\bplannot #1} +\fi +} % % New environment for (foreign) reviews @@ -1055,6 +1168,13 @@ } % +% Citation info +% +\DeclareFieldFormat{citations}{% + \bibstring{citations}\addcolon\addspace#1% +} + +% % Impact factor % \DeclareFieldFormat{impactfactor}{% @@ -1112,21 +1232,25 @@ % from publist \defbibcheck{nosubmitted}{% \edef\tmpps{\bibstring{submitted}}% - \iffieldequals{pubstate}{\tmpps}{\skipentry}{}% + \iffieldequals{pubstate}{\tmpps}{\skipentry}{% + \iffieldequalstr{pubstate}{submitted}{\skipentry}{}}% } % check to exclude work in preparation % from publist \defbibcheck{noprepared}{% \edef\tmpps{\bibstring{inpreparation}}% - \iffieldequals{pubstate}{\tmpps}{\skipentry}{}% + \iffieldequals{pubstate}{\tmpps}{\skipentry}{% + \iffieldequalstr{pubstate}{inpreparation}{\skipentry}{}}% } % check to exclude all work which is not (pre-)published \defbibcheck{onlypublished}{% \iffieldundef{pubstate}{}{% \edef\tmpps{\bibstring{prepublished}}% - \iffieldequals{pubstate}{\tmpps}{}{\skipentry}% + \iffieldequals{pubstate}{\tmpps}{% + \iffieldequalstr{pubstate}{prepublished}{}{\skipentry}% + }{\skipentry}% }% } @@ -1137,11 +1261,36 @@ \edef\tmppss{\bibstring{forthcoming}}% \iffieldequals{pubstate}{\tmpps}{}{% \iffieldequals{pubstate}{\tmppss}{}{% - \skipentry}% - }% + \iffieldequalstr{pubstate}{prepublished}{}{% + \iffieldequalstr{pubstate}{forthcoming}{}{% + \skipentry}% + }% + }% + }% }% } +% check to exclude all work which is not peer-reviewed +\defbibcheck{onlypr}{% + \iffieldundef{peerreview}{\skipentry}{% + \edef\tmppr{\bibstring{no}}% + \iffieldequals{peerreview}{\tmpps}{\skipentry}{% + \iffieldequalstr{peerreview}{no}{\skipentry}{}% + }% + }% +} + +% check to exclude all work which *is* peer-reviewed +\defbibcheck{nopr}{% + \iffieldundef{peerreview}{}{% + \edef\tmppr{\bibstring{no}}% + \iffieldequals{peerreview}{\tmpps}{}{% + \iffieldequalstr{peerreview}{no}{}{\skipentry} + }% + }% +} + + % % Count non-plauthors @@ -1327,6 +1476,26 @@ \iftoggle{isplauthor}% {% <- TRUE condition \global\toggletrue{hadplauthor}% + \ifx\bpl@annots\empty\else + \gdef\bpl@extra@annots{}% + \renewcommand*{\do}[1]{% + \ifitemannotation{##1} + {% + \iftoggle{bpl@have@extrainfo}% + {\gappto\bpl@extra@annots{\plextrainfosep\ifbibstring{annot:##1}% + {\bibstring{annot:##1}}% + {##1}}% + }% + {\gappto\bpl@extra@annots{\ifbibstring{annot:##1}% + {\bibstring{annot:##1}}% + {##1}}% + }% + \toggletrue{bpl@have@extrainfo}% + }% + {}% + }% + \expandafter\docsvlist\expandafter{\bpl@annots}% + \fi% }% <- end TRUE condition {% <- FALSE condition \stepcounter{nonpl#1}% @@ -1350,7 +1519,7 @@ {\ifdefvoid{\namepartgiven}{}{\mkbibnamegiven{\namepartgiven}\addspace}}% \ifdefvoid{\namepartprefix}{}{\mkbibnameprefix{\namepartprefix}\addspace}% \global\togglefalse{plauthorprecedes}% - \namepartfamily% + \mkbibnamefamily{\namepartfamily}% }% }% <- end FALSE condition % @@ -1689,6 +1858,12 @@ }% } +% +% Extra information +% + +\def\bpl@extra@annots{} + \newtoggle{bpl@have@extrainfo} \renewbibmacro*{addendum+pubstate}{% @@ -1710,14 +1885,35 @@ not test {\iffieldundef{impactfactor}} and test {\iftoggle{bpl@jifinfo}} ) + or + ( + not test {\iffieldundef{citations}} + and test {\iftoggle{bpl@citinfo}} + ) + or + ( + not test {\ifcsvoid{bpl@extra@annots}} + ) }{% \newunit\newblock% \printtext[plextrainfo]{% + \ifx\bpl@extra@annots\empty\else + \bpl@extra@annots% + \toggletrue{bpl@have@extrainfo}% + \fi \ifboolexpr{ not test {\iffieldundef{peerreview}} and test {\iftoggle{bpl@prinfo}} }{% - \toggletrue{bpl@have@extrainfo}% + \iftoggle{bpl@have@extrainfo}{\plextrainfosep}{}% \printfield{peerreview}% + \toggletrue{bpl@have@extrainfo}% + }{}% + \ifboolexpr{ not test {\iffieldundef{citations}} + and test {\iftoggle{bpl@citinfo}} + }{% + \iftoggle{bpl@have@extrainfo}{\plextrainfosep}{}% + \printfield{citations}% + \toggletrue{bpl@have@extrainfo}% }{}% \ifboolexpr{ not test {\iffieldundef{openaccess}} and test {\iftoggle{bpl@oainfo}} @@ -1739,6 +1935,11 @@ % % l7n % + +\DeclareLanguageMappingSuffix{-publist} + +% publist-specific bibstrings +\NewBibliographyString{citations} \NewBibliographyString{with} \NewBibliographyString{parttranslationof} \NewBibliographyString{impactfactor} @@ -1753,54 +1954,8 @@ \NewBibliographyString{peerreview:tp} \NewBibliographyString{peerreview:pp} \NewBibliographyString{peerreview:no} -\DefineBibliographyStrings{english}{% - parttranslationof = {partial translation of}, - with = {with}, - impactfactor = {impact factor}, - openaccess:true = {OpenAccess}, - openaccess:gold = {OpenAccess (gold)}, - openaccess:green = {OpenAccess (green)}, - peerreview:sb = {single blind peer review}, - peerreview:db = {double blind peer review}, - peerreview:op = {open peer review}, - peerreview:co = {collaborative peer review}, - peerreview:cc = {cascading peer review}, - peerreview:tp = {third-party peer review}, - peerreview:pp = {post-publication peer review}, - peerreview:no = {no peer review} -} -\DefineBibliographyStrings{french}{% - parttranslationof = {traduction partielle de}, - with = {avec}, - impactfactor = {facteur d'impact}, - openaccess:true = {libre acc\`es}, - openaccess:gold = {libre acc\`es (dorée)}, - openaccess:green = {libre acc\`es (verte)}, - peerreview:sb = {\'{e}valuation par des pairs anonymis\'{e}s}, - peerreview:db = {\'{e}valuation par les pairs en double aveugle}, - peerreview:op = {\'{e}valuation par les pairs ouverte}, - peerreview:co = {\'{e}valuation par les pairs collaborative}, - peerreview:cc = {\'{e}valuation par les pairs en cascade}, - peerreview:tp = {\'{e}valuation par des pairs ext\'{e}rieurs}, - peerreview:pp = {\'{e}valuation par les pairs apr\`{e}s publication}, - peerreview:no = {pas d'\'{e}valuation par les pairs} -} -\DefineBibliographyStrings{german}{% - parttranslationof = {Teil\"ubersetzung von}, - with = {mit}, - impactfactor = {Impactfaktor}, - openaccess:true = {OpenAccess}, - openaccess:gold = {OpenAccess (gold)}, - openaccess:green = {OpenAccess (gr\"un)}, - peerreview:sb = {Blindbegutachtung}, - peerreview:db = {Doppelblindbegutachtung}, - peerreview:op = {Offene Begutachtung}, - peerreview:co = {Kollaborative Begutachtung}, - peerreview:cc = {Cascading-Begutachtung}, - peerreview:tp = {Begutachtung durch Dritte}, - peerreview:pp = {Post-Publication-Begutachtung}, - peerreview:no = {keine Begutachtung} -} +\NewBibliographyString{annot:main} +\NewBibliographyString{annot:corresponding} % |