我正在尝试完善我的参考书目,但我使用的 bibstyle 有点问题。请记住,我搜索了很长时间才找到符合我期望的东西,甚至达到这种程度,所以我真的不想要告诉我只需搜索一种新的预编码样式的答案。所以我使用样式trad-abbrv
我找到的样式这里。我的问题是条目类型incollection
,它只是用逗号分隔单词“editors”。我希望它看起来完全一样,只有单词“editors”在括号中(见下面的示例)。有没有简单的方法可以做到这一点?
梅威瑟:
\documentclass{article}
\usepackage[style=trad-abbrv]{biblatex}
\addbibresource{ref.bib}
\setlength{\parindent}{0pt}
\begin{document}
This is the reference \cite{ref}.\medskip
How I would like it to look:
A. Author and B. Buthor. Title. In E. Editor and F. Fditor (editors) \textit{Booktitle}, pages 50-100. Publisher, 2021\medskip
How it actually looks:
\printbibliography
\end{document}
答案1
标准样式有editortype
(editortypedelim
参见https://tex.stackexchange.com/a/419595/35864和https://tex.stackexchange.com/a/173778/35864),但biblatex-trad
它有自己的宏,我们需要修改它。
\documentclass{article}
\usepackage[style=trad-abbrv]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewbibmacro*{byeditor+others}{%
\ifnameundef{editor}
{}
{\printnames[byeditor]{editor}%
\setunit{\addspace}%
\usebibmacro{editorlstr}%
\clearname{editor}%
\printunit{\addspace}}%
\usebibmacro{byeditorx}%
\usebibmacro{bytranslator+others}}
\renewbibmacro*{editorlstr}{%
\printtext[parens]{%
\ifboolexpr{
test {\ifnumgreater{\value{editor}}{1}}
or
test {\ifandothers{editor}}
}%
{\biblstring{editors}}%
{\biblstring{editor}}}}
\begin{document}
This is the reference \cite{westfahl:space,brandt,pines}.
\printbibliography
\end{document}