gpt4 book ai didi

latex - 使用\bibentry 显示内联引文前的数字

转载 作者:行者123 更新时间:2023-12-04 11:02:21 24 4
gpt4 key购买 nike

我想在 \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}

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}

它应该产生:
enter image description here

关于latex - 使用\bibentry 显示内联引文前的数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58727134/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com