我同时使用\bibliographystyle{apalike}
和\usepackage{natbib}
。我需要一二三(1234)而不是一等人(1234)默认情况下,对于\citet
and \citep
—not \citet*
or \citep*
。我尝试使用\usepackage{biblatex}
以下这个帖子,但它引起了类似的问题已定义问题. 如何使用以下 MWE 执行此操作?
\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike}
\begin{document}
\citet{asdf}
\bibliography{asdf}
\end{document}
@article{asdf,
title={asdf},
author={One, One and Two, Two and Three, Three},
journal={asdf},
volume={1},
number={1},
pages={1--2},
year={1234}
}
答案1
apalike
不是“原生”natbib
样式之一。它比 旧得多natbib
,并且不支持 的所有natbib
功能(例如,它不支持带星号的命令\citet*
和\citep*
)。
通过编辑文件可以获得所需的输出.bst
。
apalike.bst
在您的机器上找到。您可以通过kpsewhich apalike.bst
在命令行/终端中输入来执行此操作。或者,从 CTAN 获取该文件的副本http://mirrors.ctan.org/biblio/bibtex/base/apalike.bst将文件复制到 TeX 可以找到的位置。文档目录就可以了。另请参阅https://texfaq.org/FAQ-inst-wlcf
将文件重命名为
apalike-three.bst
(许可证apalike.bst
要求您在修改文件时更改名称)查找
FUNCTION {format.lab.names}
(ll. 841-587) 并将完整函数定义替换为FUNCTION {format.lab.names} { 's := s #1 "{vv~}{ll}" format.name$ s num.names$ duplicate$ duplicate$ #3 > { pop$ pop$ " et~al." * } { #2 < 'pop$ { #2 = { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { " and " * s #2 "{vv~}{ll}" format.name$ * } if$ } { ", " * s #2 "{vv~}{ll}" format.name$ * s #3 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { " et~al." * } { ", and " * s #3 "{vv~}{ll}" format.name$ * } if$} if$ } if$ } if$ }
查找
FUNCTION {calc.label}
(ll. 896-912) 并将完整函数定义替换为FUNCTION {calc.label} { type$ "book" = type$ "inbook" = or 'author.editor.key.label { type$ "proceedings" = 'editor.key.label % apalike ignores organization 'author.key.label % for labeling and sorting if$ } if$ "(" % these three lines are * % for apalike, which year field.or.null purify$ #-1 #4 substring$ % uses all four digits * ")" * 'label := }
为了避免
natbib
错误解析姓名列表,这一改变是必要的。在文件顶部添加一条包含您的姓名、当前日期和更改的简短描述的评论。
在您的文档中使用
\bibliographystyle{apalike-three}
而不是。\bibliographystyle{apalike}
作为步骤 1 至 5 的替代方案,您可以在以下位置获取该文件的修补版本https://gist.github.com/moewew/e3d3ed6ebc93b5e05d6394813f5ad3e5
然后
\documentclass{article}
\usepackage{natbib}
\bibliographystyle{apalike-three}
\begin{filecontents}{\jobname.bib}
@article{asdf3,
title = {asdf},
author = {One, One and Two, Two and Three, Three},
journal = {asdf},
volume = {1},
number = {1},
pages = {1--2},
year = {1234},
}
@article{asdf2,
title = {asdf},
author = {One, One and Two, Two},
journal = {asdf},
volume = {1},
number = {1},
pages = {1--2},
year = {1234},
}
@article{asdf1,
title = {asdf},
author = {One, One},
journal = {asdf},
volume = {1},
number = {1},
pages = {1--2},
year = {1234},
}
@article{asdf4,
title = {asdf},
author = {One, One and Two, Two and Three, Three and Four, Four},
journal = {asdf},
volume = {1},
number = {1},
pages = {1--2},
year = {1234},
}
\end{filecontents}
\begin{document}
\citet{asdf1}
\citet{asdf2}
\citet{asdf3}
\citet{asdf4}
\bibliography{\jobname}
\end{document}
给出