我试图让 bibtex 表现得像 natbib,带有作者年份引用,并在参考书目中使用类似 [作者等年份] 的标签。
我想我必须弄乱bibtex.bst 中的makelabel:alpha:format
函数makelabel:alpha:year
,但我就是无法让它工作。
以下是我在 MWE 中得到的信息:
\documentclass{article}
\usepackage[citestyle=authoryear, bibstyle=alphabetic, natbib, backend=bibtex]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{whatever,
author = {Author, A.},
year = {2001},
title = {Testing the effects of biblatex styles on bibliography formatting},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citep{whatever}
\printbibliography
\end{document}
如您所见,我已将makelabel:alpha:year
函数更改为
FUNCTION {makelabel:alpha:year} {
dateyear purify
#1 #4 substring$
#1 #4 substring$
}
这样我就得到了完整的四位数年份。当然,较长的作者列表应为 [firstauthor et al. year],两位作者应写为 [firstauthor & secondauthor year]。
labelalpha
我想也可以通过某种方式改变via的定义\DeclareLabelalphaTemplate
,但我也没能做到这一点……
你能帮我吗?
答案1
这看起来像是一种奇怪的风格混合,所以我不确定这是否是您想要的。它也使用 Biber。我认为您可能对 BibTeX 要求过高(但我很久以前就停止使用它了)。
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{whatever,
author = {Author, A.},
year = {2001},
title = {Testing the effects of biblatex styles on bibliography formatting},
}
@misc{whatever2,
author = {Author, A. and Buther, B.},
year = {2001},
title = {Testing the effects of biblatex styles on bibliography formatting},
}
@misc{whatever3,
author = {Author, A. and Buther, B. and Cuther, C.},
year = {2001},
title = {Testing the effects of biblatex styles on bibliography formatting},
}
\end{filecontents}
\usepackage[
citestyle=authoryear,
%citestyle=alphabetic,
bibstyle=alphabetic,
maxcitenames=2,
maxalphanames=2,
minalphanames=1,
natbib,
backend=biber]{biblatex}
\addbibresource{\jobname.bib}
\renewcommand*{\labelalphaothers}{\addspace et al{.}}
\DeclareLabelalphaTemplate{
\labelelement{
\field[strwidth=20,strside=left,ifnames=3-, namessep={\space}]{labelname}
\field[strwidth=20,strside=left,ifnames=2, namessep={\space and\space}]{labelname}
\field[strwidth=20,strside=left]{labelname}
}
\labelelement{\literal{,~}}
\labelelement{
\field[strwidth=4,strside=right]{year}
}
}
\begin{document}
\citep{whatever, whatever2, whatever3}
\printbibliography
\end{document}