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

标签 latex bibliography

我想显示由 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/

相关文章:

html - Gitbook章节引用书目不按字母顺序排列

r - 如何让 org-mode 导出宽或长表以便在 PDF 中可读?

python - LaTeX 与 Python 3.7 和 Matplotlib

latex - 在LaTeX中,如何转义打印出一段文本

r - 如何在 Rmarkdown 的引用文献中获取阿拉伯字符?

r - 如何仅提供R Markdown 引用中的年份?

latex - 使用 LaTeX,如何在每个部分的末尾列出引用文献?

matlab - 你如何在 MATLAB 中使用 LaTeX 黑板字体?

latex - 在 LaTeX 中向图形标题添加方程或公式