如何使用 BibTeX (elsarticle) 将完整的参考文献插入摘要

如何使用 BibTeX (elsarticle) 将完整的参考文献插入摘要

下列的[1]

\documentclass{article}
\usepackage[numbers]{natbib}
\usepackage{bibentry}

\newcommand{\ignore}[1]{}
\newcommand{\nobibentry}[1]{{\let\nocite\ignore\bibentry{#1}}}
% apsrev entries in the text need definitions of these commands
\newcommand{\bibfnamefont}[1]{#1}
\newcommand{\bibnamefont}[1]{#1}

\begin{document}
\nobibliography*

In my abstract I want to talk about \nobibentry{bil2012new}.

In the body of the text there is \cite{Smith:2013jd}, and also I talk
about \cite{maur2015}, but I should also not forget to cite
somewhere the \cite{bil2012new}.

\bibliographystyle{apsrev}
\bibliography{sample.bib}

\end{document}

我随心所欲地

在我的摘要中,我想谈谈 N. Bil,Journal of XYZ 125, 4390 (2012)。正文中有 [1],并且我也谈到了[2],但我也不应忘记在某处引用[3]。

但是,如果我documentclass

\documentclass[preprint,12pt]{elsarticle}

和书目风格

\bibliographystyle{model1-num-names}
\bibliography{sample.bib}

(按照要求)

我无法得到类似的输出。

感谢提供任何解决方法。

答案1

该包的bibentry工作原理是假设.bbl文件中的每个条目后面都有一个空行,但不幸的是,model1-num-names.bst它并不尊重这一惯例。

修改 的副本model1-num-names.bstmodel1-num-names+blank.bst如下所示(添加了行号以供参考)并将修改后的副本放在工作目录中:

 91 FUNCTION {fin.entry}
 92 { add.period$
 93   write$
 94   newline$
 95 }

变成

 91 FUNCTION {fin.entry}
 92 { add.period$
 93   write$
 94   newline$
 95   newline$
 96 }

这是一个有效的例子:

\begin{filecontents*}{\jobname.bib}
@article{one,
  author={A. Uthor},
  title={Title},
  journal={Journal},
  year={2010},
}
@article{two,
  author={A. Uthor},
  title={Title 2},
  journal={Journal},
  year={2011},
}
@article{three,
  author={W. Riter},
  title={Title},
  journal={Journal},
  year={2012},
}
@article{four,
  author={S. C. I. Entist},
  title={Title},
  journal={Journal},
  year={2013},
}
\end{filecontents*}

\documentclass[preprint,12pt]{elsarticle}
\usepackage{bibentry}

\newcommand{\ignore}[1]{}
\newcommand{\nobibentry}[1]{{\let\nocite\ignore\bibentry{#1}}}

\begin{document}
\nobibliography*

\begin{frontmatter}
\title{Title}
\author{Me}

\begin{abstract}
In my abstract I want to talk about \nobibentry{one}.
\end{abstract}
\end{frontmatter}

In the body of the text there is \cite{three}, and also I talk
about \cite{two,four}, but I should also not forget to cite
somewhere the \cite{one}.

\bibliographystyle{model1-num-names+blank}
\bibliography{\jobname}

\end{document}

在此处输入图片描述

相关内容