使用 \bibentry 显示内联引用前面的数字

Showing the number in front of an inline citation with \bibentry

我想在 \bibentrybibentry 包中生成的完整内嵌引文前面显示数字,与参考书目中出现的数字相匹配。

在下面的 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}

This image shows the output of the above MWE

我猜 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}

它应该产生: