问题

问题

问题

我想在文中引用参考文献,并引用整个条目,并在末尾列出参考文献列表。为此,我使用了hyperrefbibentrynatbib我将其作为灵感这个帖子。唯一的区别是我还想包含一个参考列表。

问题在于超链接指向的是\bibentry而不是参考文献中的条目。

平均能量损失

\documentclass{article}
\usepackage{natbib}
\bibliographystyle{abbrvnat}

\usepackage{bibentry}
\makeatletter\let\saved@bibitem\@bibitem\makeatother
\usepackage{hyperref}
\makeatletter\let\@bibitem\saved@bibitem\makeatother

\begin{document}
\nobibliography*
Here is a citation \citet{elvis}
%\newpage %uncomment this line and the line below eliminates error but hyperlink still points to \bibentry

Here is the full entry \bibentry{elvis}
%\newpage %uncomment this line 

\bibliography{bibliography}
\end{document}

bib 文件,bibliography.bib

@Book{elvis,
    author = "Elvis Presley",
    title = "Turn Me One More Time",
    publisher = "Jail House Books",
    year = 1963,
}

警告

上述代码给出了一个警告:

destination with the same identifier (name{cite.elvis}) has been already used, duplicate ignored

解决方案?

  • 有趣的是,添加s 将和\newpage拆分到不同的页面上可以消除警告,但超链接仍然是错误的。\citet\bibentry
  • 删除natbib但超链接再次不起作用。

有人知道我该如何解决这个问题吗?

答案1

\bibentryNoHyperie

\begin{NoHyper}\bibentry{elvis}\end{NoHyper}

超链接现在指向参考文献中的正确条目。

答案2

我会把这个添加到顶部答案的评论线程中,但我还没有评论所需的声誉。关于鲁本响应环境\bibentry中的包装的请求NoHyper

这确实修复了内部文档链接,但如果参考书目条目本身有超链接,不幸的是,它不再是超链接。如果能同时实​​现两者,那就太好了。

您可以避开NoHyper一个简单的解决方案,将引用正确地超链接到其相应的非\bibentry参考项目(同时维护\bibentry类似 URL 中的现有超链接):

在您的.bib文件中(或者如果您已经在序言中定义了书目条目),完整复制这些参考文献,并在引用关键字中添加一些区分文本。我喜欢将其添加到-in我将用于项目的引用关键字的末尾\bibentry,因为它们将合并到-in文本中。然后,添加multibib环境到你的.tex文件正如这个答案所述。如果您尝试使用multibib而不重复.bib感兴趣的条目,引用仍然会跳转到\bibentry而不是参考书目。

平均能量损失

超链接失效

test.bib文件:

@article{Lee:2011ct,
author = {Lee, Hun and Lee, Kangsun and Ahn, Byungwook and Xu, Jing and Xu, Linfeng and Oh, Kwang W},
title = {{A new fabrication process for uniform SU-8 thick photoresist structures by simultaneously removing edge bead and air bubbles}},
journal = {Journal of Micromechanics and Microengineering},
year = {2011},
volume = {21},
number = {12},
pages = {125006--9},
month = nov,
doi = {10.1088/0960-1317/21/12/125006},
read = {Yes},
date-added = {2018-06-21T17:15:45GMT},
url = {http://stacks.iop.org/0960-1317/21/i=12/a=125006?key=crossref.dabe730af97ae5fbb7d5b6bb62b8eb90}}

test.tex文件:

\documentclass{article}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{bibentry}

\begin{document}
\nobibliography*

Here is a citation \citet{Lee:2011ct}

Here is the full entry \bibentry{Lee:2011ct}

\newpage

\bibliography{test}
\bibliographystyle{abbrvnat}

\end{document}

这样,我们将看到从第一个实例\citet\bibentry(而不是References下一页的部分)的不正确的超链接。

固定超链接

.bib通过复制和修改我们想要包含的项目\bibentry并调整文件可以轻松解决这个问题.tex

test.bib文件:

@article{Lee:2011ct,
author = {Lee, Hun and Lee, Kangsun and Ahn, Byungwook and Xu, Jing and Xu, Linfeng and Oh, Kwang W},
title = {{A new fabrication process for uniform SU-8 thick photoresist structures by simultaneously removing edge bead and air bubbles}},
journal = {Journal of Micromechanics and Microengineering},
year = {2011},
volume = {21},
number = {12},
pages = {125006--9},
month = nov,
doi = {10.1088/0960-1317/21/12/125006},
read = {Yes},
date-added = {2018-06-21T17:15:45GMT},
url = {http://stacks.iop.org/0960-1317/21/i=12/a=125006?key=crossref.dabe730af97ae5fbb7d5b6bb62b8eb90}}

@article{Lee:2011ct-in,
author = {Lee, Hun and Lee, Kangsun and Ahn, Byungwook and Xu, Jing and Xu, Linfeng and Oh, Kwang W},
title = {{A new fabrication process for uniform SU-8 thick photoresist structures by simultaneously removing edge bead and air bubbles}},
journal = {Journal of Micromechanics and Microengineering},
year = {2011},
volume = {21},
number = {12},
pages = {125006--9},
month = nov,
doi = {10.1088/0960-1317/21/12/125006},
read = {Yes},
date-added = {2018-06-21T17:15:45GMT},
url = {http://stacks.iop.org/0960-1317/21/i=12/a=125006?key=crossref.dabe730af97ae5fbb7d5b6bb62b8eb90}}

test.tex文件:

\documentclass{article}
\usepackage{natbib}
\usepackage{hyperref}
\usepackage{bibentry}
\usepackage{natbib}
\usepackage{multibib}
\newcites{q}{References}

\begin{document}
\nobibliography*

Here is a citation \citetq{Lee:2011ct}

Here is the full entry \bibentry{Lee:2011ct-in}

\newpage

\bibliographystyleq{abbrvnat}
\bibliographyq{test.bib}
\bibliographystyle{abbrvnat}
\nobibliography{test.bib}

\end{document}

这将产生您想要的输出:文内引用链接到参考书目,并且项目中的 URL 在\bibentry没有超链接到文内引用的情况下仍然有效。要编译此.tex文件,请使用以下构建顺序:

pdflatex test.tex
bibtex q
bibtex test
pdflatex test
pdflatex test

我知道自从第一次提出这个问题已经过去了将近六年,但我最近发现这个解决方案很有用,并希望它能够被任何可能遇到这个线程的人使用。

答案3

使用两个包也很有帮助:natbib 和 bibentry。

然后这个问题对我来说就解决了。

因此,利用:

\usepackage{natbib}
\usepackage{bibentry}
\usepackage{fancyhdr}
\usepackage{hyperref}

干杯!

答案4

您可以重新定义\bibentry以省略其内部超链接:

\makeatletter
\renewcommand{\bibentry}[1]{\nocite{#1}{\frenchspacing\@nameuse{BR@r@#1\@extra@b@citeb}}}
\makeatother

相关内容