我无法让 \bibentry 命令在正文中生成完整的引文。末尾的参考书目中的引用完美无缺,但在正文中却没有任何输出。下面是一个说明该问题的最小示例。
\documentclass{article}
\usepackage{natbib, bibentry}
\bibliographystyle{agsm}
\begin{document}
This is supposed to cite in full. Instead I get nothing! \bibentry{Bloggs1950}
\bibliography{fict}
\end{document}
fict.bib 的内容如下
@article{Bloggs1950,
author = "{Bloggs}, {Joseph K.}",
journal = "International Journal of Dubious Assertions",
pages = "337-629",
title = "{Misusing Scientific Terminology for Fun and Profit}",
volume = "202",
year = "1950"
}
我该如何解决这个问题?谢谢。
答案1
请参阅有关切换到biblatex
和的评论biber
- 如果您想继续使用bibtex
,请继续阅读。
你缺少了\nobibliography*
命令 - 请参阅文档和这里了解详情。
但即使使用该\nobibliography*
命令也没有输出\bibentry
- 这似乎是样式的问题,agsm
因为切换到plain
样式确实可以解决问题:
\documentclass{article}
\usepackage{natbib, bibentry}
%\bibliographystyle{agsm}
\bibliographystyle{plain}
\begin{filecontents}{\jobname.bib}
@article{Bloggs1950,
author = "{Bloggs}, {Joseph K.}",
journal = "International Journal of Dubious Assertions",
pages = "337-629",
title = "{Misusing Scientific Terminology for Fun and Profit}",
volume = "202",
year = "1950"
}
\end{filecontents}
\begin{document}
\nobibliography*
Citation: \cite{Bloggs1950}.
This is supposed to cite in full. Instead I get nothing! \bibentry{Bloggs1950}
\bibliography{\jobname}
\end{document}
问题确实出在使用agsm
样式创建的 .bbl 文件的格式上——比较一下创建的 .bbl:
\begin{thebibliography}{1}
\bibitem{Bloggs1950}
{Joseph K.} {Bloggs}.
\newblock {Misusing Scientific Terminology for Fun and Profit}.
\newblock {\em International Journal of Dubious Assertions}, 202:337--629,
1950.
\end{thebibliography}
采用“4.注意事项”文档中提到的格式:
\bibitem[<label>]{<key>}
Text of the reference entry.
\bibitem
它们显然不合适。
答案2
对我来说,它的工作原理如下:
\documentclass{article}
\usepackage{bibentry}
\usepackage{natbib}
\nobibliography* % here!
\bibliographystyle{plain}
\begin{document}
\bibentry{foo}
\bibliography{main}
\end{document}
显然, 的位置\nobibliography*
很重要。将其移除或放置在其后\begin{document}
,您将得到一个空的输出。