在 biblatex 中的速记中添加星号

在 biblatex 中的速记中添加星号

我搜索了所有我知道的资料,但似乎找不到解决问题的方法。我提出这个问题的背景是,我想用星号标记一些参考文献,因为它们的作者非常优秀。我想标记简写,因为读者在阅读文档时应该知道这些参考文献是特殊的。

我目前拥有的是以下 MWE(我从这个论坛获得的)。

\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber]{biblatex} 

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{bohec,
  author        = {Le Bohec, Yann},
  title         = {Histoire militaire des guerres puniques},
  date          = {1996},
  location      = {Monaco},
  publisher     = {Rocher},
  isbn          = {2-268-02147-5},
}
@book{uthor,
  author        = {Uthor, Arnold},
  title         = {A Book},
  date          = {2013},
  location      = {Place},
  publisher     = {P. Ublisher's \& Co.},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareBibliographyCategory{asterisk}

\renewbibmacro*{bibindex}{%
  \ifbibindex
    {\indexnames{labelname}%
     \indexfield{indextitle}}
    {}
  \ifcategory{asterisk}%
    {*}%
    {}}


\begin{document}
  \addtocategory{asterisk}{uthor,bohec}
  \cite{wilde,cicero,coleridge,vangennep,bohec,uthor}
  \printbibliography
\end{document}

这将产生以下输出。

电流输出

我希望参考文献列表中的星号不要放在第一作者之前,而是以速记形式出现,如下所示(使用 MS Word 复制):

期望输出

您知道如何实现这一点吗?我将非常感谢您的意见!

答案1

您可以使用:

\DeclareFieldFormat{labelnumber}{\ifcategory{asterisk}{#1*}{#1}}

在全:

\documentclass[american]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber]{biblatex} 

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{bohec,
  author        = {Le Bohec, Yann},
  title         = {Histoire militaire des guerres puniques},
  date          = {1996},
  location      = {Monaco},
  publisher     = {Rocher},
  isbn          = {2-268-02147-5},
}
@book{uthor,
  author        = {Uthor, Arnold},
  title         = {A Book},
  date          = {2013},
  location      = {Place},
  publisher     = {P. Ublisher's \& Co.},
}
\end{filecontents*}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\DeclareBibliographyCategory{asterisk}

\DeclareFieldFormat{labelnumber}{\ifcategory{asterisk}{#1*}{#1}}

\begin{document}
  \addtocategory{asterisk}{uthor,bohec}
  \cite{wilde,cicero,coleridge,vangennep,bohec,uthor}
  \printbibliography
\end{document}

在此处输入图片描述

相关内容