我想显示由 bibentry
包中的 \bibentry
生成的完整内联引用前面的数字,与引用书目中出现的数字相匹配。
在下面的 MWE 中,这将对应于缩进的 \bibentry
前面的 [2]。我该怎么做?
\documentclass[11pt]{article}
\usepackage{bibentry}
\begin{filecontents}{test.bib}
@misc{Emma,
author = "Emma",
title = "Emma's publication",
year = "2001" }
@misc{Martha,
author = "Martha",
title = "Interesting thoughts",
year = "2003" }
@misc{Paul,
author = "Paul",
title = "Paul's essay",
year = "2000" }
\end{filecontents}
\begin{document}
\nobibliography*
\noindent
This is a usual reference~\cite{Emma}.
Now I'm referring to\\[5pt]
\indent \bibentry{Martha}.\\[5pt]
The following is again a normal reference~\cite{Paul}.
\bibliography{test}
\bibliographystyle{plain}
\end{document}
最佳答案
我猜 bibentry
不允许这样做,一种可能的解决方案是定义一个新命令(或重新定义 \bibentry
)作为 \cite
和 \bibentry
。
类似的事情:
\let\oldbibentry\bibentry
\renewcommand{\bibentry}[1]{\cite{#1} \oldbibentry{#1}}
所以如果我们尝试这段代码:
\documentclass[11pt]{article}
\usepackage{bibentry}
% redefine the bibentry command as cite then bibentry
\let\oldbibentry\bibentry
\renewcommand{\bibentry}[1]{\cite{#1} \oldbibentry{#1}}
\begin{filecontents}{test.bib}
@misc{Emma,
author = "Emma",
title = "Emma's publication",
year = "2001" }
@misc{Martha,
author = "Martha",
title = "Interesting thoughts",
year = "2003" }
@misc{Paul,
author = "Paul",
title = "Paul's essay",
year = "2000" }
\end{filecontents}
\nobibliography*
\begin{document}
\noindent
This is a usual reference~\cite{Emma}.
Now I'm referring to\\[5pt]
\indent \bibentry{Martha}.\\[5pt]
The following is again a normal reference~\cite{Paul}.
\bibliography{test}
\bibliographystyle{plain}
\end{document}
关于latex - 使用\bibentry 显示内联引用前面的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58727134/