0

I'm using publist and would like to have lists of publications not numbered but formatted as in this question: Bibliography customization, year as bib label. MWE using publist is

\documentclass{article}
\usepackage[style=publist,boldyear=false,plnumbered=false,backend=biber,labeldateparts=false]{biblatex}
\plauthorname[Gary]{Westfahl}
\renewcommand{\labelnamepunct}{\addspace}
\addbibresource{biblatex-examples.bib}    
\begin{document}   
\nocite{*}   
\printbibliography[filter=mine]    
\end{document}

yielding this result: enter image description here I'd like to have this enter image description here which is produced using the answer by gusbrs, based on the alphabetic style:

\documentclass{article}

\usepackage[style=alphabetic]{biblatex}

\addbibresource{biblatex-examples.bib}

\DeclareLabelalphaTemplate{ \labelelement{ \field[strwidth=4,strside=right]{year} } }

\defbibenvironment{bibliography} {\list {\printtext[labelalphawidth]{% \printfield{labelprefix}% \printfield{labelalpha}}} {\setlength{\labelwidth}{\labelalphawidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}% \renewcommand*{\makelabel}[1]{##1\hss}} {\endlist} {\item}

\renewbibmacro*{date}{% \ifboolexpr{ test {\iffieldundef{month}} and test {\iffieldundef{season}} } {} {\printdate}}

\renewbibmacro{issue+date}{% \ifboolexpr{ test {\iffieldundef{month}} and test {\iffieldundef{season}} and test {\iffieldundef{issue}} } {} {\printtext[parens]{% \printfield{issue}% \setunit{\addspace}% \printdate}}% \newunit}

\DeclareFieldFormat{labelalphawidth}{#1}

\begin{document}

\nocite{westfahl:space,westfahl:frontier}

\printbibliography

\end{document}

But I can't see how to transpose it to publist. Nor, alas, do I see how to port moewe's answer.

Thanks to moewe for his revised code on Bibliography customization, year as bib label; it now works perfectly!

But his answer to this question is just a tad short of fully working for my purposes.

One weird thing, changing the answer MWE to \nocite{*} and running with latexmk I get an error:

! Illegal parameter number in definition of \@tempb.
<to be read again> 
                   \crcr 
l.327     \endentry?

Letting latexmk run, the result has some entries run together. For example, wassenberg, herrmann & yoon appear together with year 2010.

Now, since as shown in the screenshot above I'd like no (round brackets) around the date I changed to \DeclareFieldFormat{labeldatewidth}{#1}. I tried the author command \plauthorname[Gary]{Westfahl} together with \printbibliography[filter=mine], again with \nocite{*}, with almost perfect results, except for an extra space, or “, ed.” for collections edited by only the cv author, right before the entry. Of course \renewcommand{\labelnamepunct}{} introduces the problem of omitting the needed space after publist's “(Some Coeditor).”

ss1789
  • 559
  • Thanks for the hint that my answer to https://tex.stackexchange.com/q/419702/35864 was outdated. I fixed it and it should work with current versions of biblatex again. In principle the answer also works with biblatex-publist, but you get quite some date duplication in the output. So some additional tweaks are necessary. I shall have a look at that. – moewe Apr 25 '21 at 06:56
  • I get similar errors without my code in a simple document with just style=publist,, so this appears to be a style issue: https://gist.github.com/moewew/fc54715919a729699cbce0f94f1b1ef2. I think the minimal problematic entries are https://gist.github.com/moewew/eb8ab18b3d1e913171313a9d6be39a83. Report it to the biblatex-publist maintainer at https://github.com/jspitz/biblatex-publist/issues. – moewe Apr 25 '21 at 20:16
  • herrmann,aksin,yoon are run together because they are declared as a @set. Sets don't really have a labeldate either, so that explains why there is no date there. Probably nothing you have to worry about in your real-world document either. – moewe Apr 25 '21 at 20:28

1 Answers1

1

My fixed answer (thanks for the hint) to Bibliography customization, year as bib label is in principle also applicable to biblatex-publist, but it needs some slight modifications for the different macro names and calls of biblatex-publist. In particular biblatex-publist prints the date in bpl:year+labelyear, so we need to modify that bibmacro as well.

\documentclass{scrartcl}

\usepackage[style=publist]{biblatex}

\DeclareFieldFormat{labeldatewidth}{\mkbibparens{#1}}

\makeatletter \defbibenvironment{bibliography} {\list {\printtext[labeldatewidth]{\printlabeldate}} {\setlength{\labelwidth}{\labeldatewidth}% \setlength{\leftmargin}{\labelwidth}% \setlength{\labelsep}{\biblabelsep}% \addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibitemsep}% \setlength{\parsep}{\bibparsep}}% \renewcommand*{\makelabel}[1]{##1\hss}} {\endlist} {\item}

\renewbibmacro*{bpl:year+labelyear}{% \iffieldundef{year}{% \iffieldundef{pubstate}% {\let\bbx@lasthash\undefined}% {% \usebibmacro{bpl:date:labeldate+extradate}% \savefield{pubstate}{\bbx@lasthash}% \clearfield{pubstate}% }% }{% \ifboolexpr{ test {\iflabeldateisdate} and not test {\ifdateshavedifferentprecision{label}{}} } {\printunit{}} {\usebibmacro{bpl:date:labeldate+extradate}}% \savefield{year}{\bbx@lasthash}% \clearfield{year}% }% }

\renewbibmacro*{author}{% \if@hlauthor \ifnameundef{author} {} {% \usebibmacro{bpl:marginyear}% \printnames[][-\value{listtotal}]{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}\setunit{\addspace}% \printnames[][-\value{listtotal}]{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[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% }% \setunit{\adddot\addspace}% \usebibmacro{bpl:year+labelyear}% \clearname{editor}% \else% \if@hlauthor false \ifnameundef{editor} {} {% \usebibmacro{bpl:marginyear}% \usebibmacro{bpl:year+labelyear}% \setunit{\addspace}% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editorstrg}% \clearname{editor}% }% \fi% end of \if@hlauthor else condition }

\renewbibmacro*{editor+others}{% \if@hlauthor \ifboolexpr{ test \ifuseeditor and not test {\ifnameundef{editor}}} {% \usebibmacro{bpl:marginyear}% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \setunit{\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}% \setunit{\addspace}% \printnames[][-\value{listtotal}]{editor}% \setunit{\printdelim{editortypedelim}}% \usebibmacro{editor+othersstrg}% \clearname{editor}% } {}% \fi% end of \if@hlauthor else condition }

\newlength{\labeldatewidth} \newlength{\locallabeldatewidth}

\appto\abx@dolabelwidths{\do{labeldate}}

\AtDataInput{% \nottoggle{blx@skipbib} {\begingroup \blx@getlabeldata \blx@setlabwidth{\labeldatewidth}{% \printtext[labeldatewidth]{\printlabeldate}}% \endgroup} {}}

\AtEveryBibitem{% \blx@setlabwidth{\locallabeldatewidth}{% \printtext[labeldatewidth]{\printlabeldate}}}

\newrobustcmd*{\changedateformat}[2]{% \csdef{blx@dateformat@#1date}{#2}% \protected\csdef{blx@imc@print#1date}{\csuse{mkdaterange#2}{#1}}% \protected\csdef{blx@imc@print#1dateextra}{\csuse{mkdaterange#2extra}{#1}}} \makeatletter

\addbibresource{biblatex-examples.bib}

\begin{document} \nocite{sigfridsson,worman,geer}

\printbibliography \end{document}

Bibliography with date on the left in list margin.

moewe
  • 175,683
  • There seems to be still some conflict with publist. Not sure how exactly to report the issues, there isn't space here in a comment, so I'm editing the question. – ss1789 Apr 25 '21 at 18:26
  • Great, all working now. I'll report the issue to the publist maintainer. Many thanks, @moewe, again and as always! – ss1789 Apr 26 '21 at 00:26