目前,在我.bst
使用 BibTex 的文件中,如果条目同时包含 Journal 和 arXiv 链接,则两者都用于引用。我想要做的是使用“if”语句,表示如果定义了 Journal,则不要打印 arXiv 引用。
有任何想法吗?
我已经上传了样式文件这里如果有帮助的话。
答案1
在您的.bst
替换函数article
中
FUNCTION {article}
{ output.bibitem
format.collaboration output
format.authors "author" output.check
format.title "title" output.check
blank.sep
crossref missing$
{ journal missing$
{}
{ format.journal add.doi "journal" output.check }
if$
}
{ format.article.crossref output.nonnull
format.pages output
}
if$
journal missing$
{ format.eprint output
format.url output }
'skip$
if$
note output
new.sentence
format.SLACcitation output
fin.entry
}
新的一点是
journal missing$
{ format.eprint output
format.url output }
'skip$
if$
代替
format.eprint output
format.url output
这意味着现在仅当该字段不存在时才会打印eprint
和信息。url
journal
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{hyperref}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{appleby,
author = {Humphrey Appleby},
title = {On the Importance of the Civil Service},
year = {1980},
journal = {Civil Service Review},
volume = {138},
number = {3},
pages = {234-289},
archive = arXiv,
archivePrefix = {arXiv},
eprint = {1234.5689},
}
@article{elk,
author = {Anne Elk},
title = {On Brontosauruses},
year = {1972},
archive = arXiv,
archivePrefix = {arXiv},
eprint = {2234.5689},
}
@article{sigfridsson,
author = {Sigfridsson, Emma and Ryde, Ulf},
title = {Comparison of methods for deriving atomic charges from the
electrostatic potential and moments},
journal = {Journal of Computational Chemistry},
year = 1998,
volume = 19,
number = 4,
pages = {377-395},
doi = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents}
\begin{document}
\cite{sigfridsson,appleby,elk}
\bibliographystyle{jwsmith}
\bibliography{\jobname}
\end{document}
生产