使用 plnumbered=false 选项后,是否可以将年份作为 biblatex publist 的 bib 标签?

使用 plnumbered=false 选项后,是否可以将年份作为 biblatex publist 的 bib 标签?

我正在使用 publist,并且想要获得未编号但格式化的出版物列表,如以下问题所示:书目定制,以年份作为书目标签. MWE 使用 publist 是

\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}

得到以下结果: 在此处输入图片描述 我想要这个 在此处输入图片描述 它是使用 gusbrs 的答案生成的,基于字母样式:

\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}

但我不知道如何将其转置为 publist。唉,我也不知道如何移植 moewe 的答案。

感谢 moewe 对代码的修改书目定制,以年份作为书目标签;现在它运行完美!

但他的回答是这个问题离我的目的还差得远。

一件奇怪的事情是,将答案 MWE 更改为\nocite{*}并使用 latexmk 运行我收到错误:

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

运行 latexmk,结果显示有些条目连在一起。例如,wassenberg、herrmann 和 yoon 与 2010 年一起出现。

现在,由于如上图所示,我希望日期周围没有(圆括号),因此我将其更改为\DeclareFieldFormat{labeldatewidth}{#1}。我尝试将 author 命令\plauthorname[Gary]{Westfahl}与 一起使用\printbibliography[filter=mine],再次与 一起使用\nocite{*},结果几乎完美,除了在条目之前有一个额外的空格或“,ed。”,表示仅由 cv 作者编辑的集合。当然,这\renewcommand{\labelnamepunct}{}引入了在 publist 的“(Some Coeditor)”之后省略所需空格的问题。

答案1

我的固定答案(感谢提示)书目定制,以年份作为书目标签原则上也适用于biblatex-publist,但需要对 的不同宏名称和调用进行一些轻微的修改biblatex-publist。特别是biblatex-publist在 中打印日期bpl:year+labelyear,所以我们也需要修改该 bibmacro。

\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}

参考书目及日期位于列表边缘的左侧。

相关内容