From 4cf7d112766b5888982c9970e69c3763e69456a2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 6 Aug 2016 22:38:19 +0000 Subject: biblatex-publist (6aug16) git-svn-id: svn://tug.org/texlive/trunk@41812 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/biblatex-publist/publist.bbx | 114 +++++++++++++++------ 1 file changed, 85 insertions(+), 29 deletions(-) (limited to 'Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx') diff --git a/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx b/Master/texmf-dist/tex/latex/biblatex-publist/publist.bbx index 7735af60fc7..2f48be67bfe 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.2} -\def\bpl@rdate{2016/05/12} +\def\bpl@version{1.3} +\def\bpl@rdate{2016/08/06} \ProvidesFile{publist.bbx}[\bpl@rdate\space v.\bpl@version\space biblatex bibliography style (JSP)] @@ -40,16 +40,54 @@ This is a fatal error. I'm aborting now}% \endinput} -\RequireBibliographyStyle{authoryear} + +% +% Bibliography Options and Base Style +% + +\DeclareBibliographyOption{omitname}{\def\bpl@osurname{#1}} + +\DeclareBibliographyOption{omitfirstname}{\def\bpl@ofirstname{#1}} + +\DeclareBibliographyOption{omitnameprefix}{\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} +} + +% 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=spread, + pagetracker=true, labelnumber, useprefix=false, - dashed=false, sorting=ydnt, - defernumbers=true, - maxnames=4} + 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 % @@ -87,27 +125,6 @@ } -% -% Options -% - -\DeclareBibliographyOption{omitname}{\def\bpl@osurname{#1}} - -\DeclareBibliographyOption{omitfirstname}{\def\bpl@ofirstname{#1}} - -\DeclareBibliographyOption{omitnameprefix}{\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} -} - - % % Field format definitions % @@ -127,8 +144,13 @@ \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} - {\list + {\addtolength{\labelnumberwidth}{\extralabelnumberwidth}% + \list {\printtext[labelnumberwidth]{% \printfield{labelprefix}% \printfield{labelnumber}}} @@ -160,6 +182,7 @@ \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}} @@ -438,6 +461,7 @@ }% \fi \savefield{labelyear}{\bbx@lasthash}% + \clearfield{year}% }} \newbibmacro*{rauthor/label}{% @@ -626,4 +650,36 @@ } } +% +% 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}] + } + } +} + + \endinput -- cgit v1.2.3