我正在编辑一份要提交给 Elsevier 期刊的文档。Elsevier 文档类使用 natbib 来处理引用。我遇到了引用显示问题,这些引用的作者是机构或组织。例如,如果作者是“美国能源部”,我知道我可以使用双括号强制输出按我指定的方式显示:
Author = {{US Department of Energy}}
我遇到的麻烦是,虽然这达到了预期的效果,但是 bibtex 将作者姓名视为姓氏,因此在参考文献列表中将其格式化为:
美国能源部,。
使用\usepackage[nodots]{numcompress}
可以去掉逗号,但作者末尾和句号之间仍会有一个空格。查看 bbl 文件发现 bibtex\xfnm[]
在作者姓名后添加了内容。如果我在 bbl 文件中的作者姓名中删除此元素,多余的逗号和空格就会消失。我知道问题部分是由于我使用的 bst 文件造成的,但我不应该替换其他格式。我能做些什么来防止 bibtex 首先将这个额外的元素添加到 bbl 文件中?
MWE:tex 标记
\documentclass[11pt]{article}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}
\begin{document}
Here I am going to use a reference with an institutional author~\cite{BTS2012}.
\bibliographystyle{model3-num-names}
\bibliography{sources}
\end{document}
MWE:bibtex 文件(sources.bib)
@misc{BTS2012,
Author= {{Bureau of Transportation Statistics}},
Howpublished = {\url{http://www.bts.gov/programs/national_household_travel_survey/daily_travel.html}},
Publisher = {{Department of Transportation}},
Title = {{National Household Travel Survey: Daily Travel Quick Facts}},
Year = {2012}}
下载关联如果需要,可以使用 model3-num-names.bst。
新 MWE(演示作者姓名双句号格式问题)
\begin{filecontents*}{\jobname.bib}
@misc{BTS2012,
Author= {{Bureau of Transportation Statistics}},
Howpublished = {\url{http://www.bts.gov/programs/national_household_travel_survey/daily_travel.html}},
Publisher = {{Department of Transportation}},
Title = {{National Household Travel Survey: Daily Travel Quick Facts}},
Year = {2012}}
@article{Shaw1985,
Author = {Shaw, John J and Gendron, Robert F and Bertsekas, Dimitri P},
Journal = {IEEE Transactions on Power Apparatus and Systems},
Number = {2},
Pages = {286--294},
Title = {{Optimal Scheduling of Large Hydrothermal Power Systems}},
Volume = {104},
Year = {1985}}
}
\end{filecontents*}
\documentclass[11pt]{article}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}
\usepackage[nodots]{numcompress}
\begin{document}
Here's a reference with an institutional author~\cite{BTS2012}. Here's a journal reference~\cite{Shaw1985}. Notice how the periods terminating the authors' first and middle initials have been removed, and thus only a final period terminates the list of author names, rather than a terminating double period (which would appear as Bertsekas, D.P..).
\bibliographystyle{model3-num-names}
\bibliography{\jobname}
\end{document}
下载关联对于 numcompress 包的修改版本(参见第 167 行)。
答案1
第一个名称仅当之前未定义时才会作为环境中定义的命令的.bbl
参数记录在文件中。因此,您可以在序言中定义它,这样当参数不为空时,它会执行通常的操作,但如果参数为空,则不执行任何操作。\xfnm
thebibliography
在示例中,我添加了一个(不完整的)条目,只是为了显示名字被正确拾取。诀窍filecontents*
就是让示例自成一体。
\begin{filecontents*}{\jobname.bib}
@misc{BTS2012,
Author= {{Bureau of Transportation Statistics}},
Howpublished = {\url{http://www.bts.gov/programs/national_household_travel_survey/daily_travel.html}},
Publisher = {{Department of Transportation}},
Title = {{National Household Travel Survey: Daily Travel Quick Facts}},
Year = {2012}}
@article{x,
author={Adam. Uthor},
journal={Journal},
title={Title},
year={2013},
}
\end{filecontents*}
\documentclass[11pt]{article}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}
\newcommand{\xfnm}[1][]{\ifx!#1!\else\unskip,\space#1\fi}
\begin{document}
Here I am going to use a reference with an institutional author~\cite{BTS2012}.
And \cite{x}
\bibliographystyle{model3-num-names}
\bibliography{\jobname}
\end{document}
如果名字以 开头,它将不起作用!
(但这不应该是一个问题)。
如果你加载numcompress
包,不修改它。根据你的新 MWE,以下是你应该使用的代码:
\begin{filecontents*}{\jobname.bib}
@misc{BTS2012,
Author= {{Bureau of Transportation Statistics}},
Howpublished = {\url{http://www.bts.gov/programs/national_household_travel_survey/daily_travel.html}},
Publisher = {{Department of Transportation}},
Title = {{National Household Travel Survey: Daily Travel Quick Facts}},
Year = {2012}}
@article{Shaw1985,
Author = {Shaw, John J and Gendron, Robert F and Bertsekas, Dimitri P},
Journal = {IEEE Transactions on Power Apparatus and Systems},
Number = {2},
Pages = {286--294},
Title = {{Optimal Scheduling of Large Hydrothermal Power Systems}},
Volume = {104},
Year = {1985}}
}
\end{filecontents*}
\documentclass[11pt]{article}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{hyperref}
\usepackage[nodots]{numcompress}
\renewcommand{\xfnm}[1][]{\ifx!#1!\else\unskip\space\removeDot{#1}\fi}
\begin{document}
Here's a reference with an institutional author~\cite{BTS2012}. Here's a journal
reference~\cite{Shaw1985}. Notice how the periods terminating the authors' first and middle
initials have been removed, and thus only a final period terminates the list of author
names, rather than a terminating double period (which would appear as Bertsekas, D.P..).
\bibliographystyle{model3-num-names}
\bibliography{\jobname}
\end{document}