Problemas al usar los paquetes Hyperref y Bibentry juntos

Problemas al usar los paquetes Hyperref y Bibentry juntos

Recibo un error cuando uso hyperrefy bibentryempaqueto juntos. El error es:

./Test.bbl:1: LaTeX Error: Command \BR@bibitem already defined.
               Or name \end... illegal, see p.192 of the manual.

Apuntando a l.1 \begin{thebibliography}{2}, que es, por supuesto, la primera línea del Text.bblarchivo.

Testes el nombre de mi archivo MWE:

\documentclass{article}

\usepackage[pagebackref=true,linktocpage]{hyperref}
\usepackage[square]{natbib}
\usepackage{bibentry}
\nobibliography*

\begin{document}

\section{Introduction}

Look ma, inline bibtex entries:

\begin{itemize}
\item \begin{NoHyper}\bibentry{McCune:2015}\end{NoHyper}
\item \begin{NoHyper}\bibentry{Deshpande:2018aa}\end{NoHyper}
\end{itemize}

\section{And now for something completely different}
Lorem ipsum yada yada,
also see \citep{McCune:2015}, 
yada yada, and \citep{Deshpande:2018aa} too.

\bibliographystyle{abbrvnat}
\bibliography{testref}

\end{document}

El testref.bibarchivo es el siguiente:

@STRING{COMPSUR     = {ACM Comput. Surv.}}

@book{Deshpande:2018aa,
    Author = {Deshpande, Amol and Gupta, Amarnath},
    Date-Added = {2017-04-12 14:27:29 +0000},
    Date-Modified = {2017-04-12 14:28:23 +0000},
    Note = {Forthcoming},
    Publisher = {ACM Books},
    Title = {Principles of Graph Data Management and Analytics},
    Year = {2018}}

@article{McCune:2015,
    Author = {McCune, Robert Ryan and Weninger, Tim and Madey, Greg},
    Journal = COMPSUR,
    Number = {2},
    Numpages = {39},
    Pages = {25:1--25:39},
    Title = {Thinking Like a Vertex: A Survey of Vertex-Centric Frameworks for Large-Scale Distributed Graph Processing},
    Url = {http://doi.acm.org/10.1145/2818185},
    Volume = {48},
    Year = {2015}}

¿Alguna sugerencia de lo que podría estar haciendo mal? Si elimino el paquete hyperref, todo funciona. Leí artículos aquí, pero las soluciones sugeridas no ayudan: una era envolver el \bibentryque NoHypertengo en el MWE (de hecho, el MWE se toma de uno de esos).

Respuesta1

Cargue hyperrefdespués de los otros paquetes, consulte¿Qué paquetes deberían cargarse después de Hyperref en lugar de antes?por excepciones.

\begin{filecontents}{testref.bib}
@STRING{COMPSUR     = {ACM Comput. Surv.}}

@book{Deshpande:2018aa,
    Author = {Deshpande, Amol and Gupta, Amarnath},
    Date-Added = {2017-04-12 14:27:29 +0000},
    Date-Modified = {2017-04-12 14:28:23 +0000},
    Note = {Forthcoming},
    Publisher = {ACM Books},
    Title = {Principles of Graph Data Management and Analytics},
    Year = {2018}}

@article{McCune:2015,
    Author = {McCune, Robert Ryan and Weninger, Tim and Madey, Greg},
    Journal = COMPSUR,
    Number = {2},
    Numpages = {39},
    Pages = {25:1--25:39},
    Title = {Thinking Like a Vertex: A Survey of Vertex-Centric Frameworks for Large-Scale Distributed Graph Processing},
    Url = {http://doi.acm.org/10.1145/2818185},
    Volume = {48},
    Year = {2015}}

\end{filecontents}


\documentclass{article}

\usepackage[square]{natbib}
\usepackage{bibentry}
\nobibliography*
\usepackage[pagebackref=true,linktocpage]{hyperref}

\begin{document}

\section{Introduction}

Look ma, inline bibtex entries:
%
\begin{itemize}
\item \begin{NoHyper}\bibentry{McCune:2015}\end{NoHyper}
\item \begin{NoHyper}\bibentry{Deshpande:2018aa}\end{NoHyper}
\end{itemize}

\section{And now for something completely different}
Lorem ipsum yada yada,
also see \citep{McCune:2015}, 
yada yada, and \citep{Deshpande:2018aa} too.

\bibliographystyle{abbrvnat}
\bibliography{testref}

\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Cargar hyperref después de los otros paquetes puede no ser suficiente. ElhiperreferenciaEl manual sugiere la siguiente solución (cambie "base de datos" con su propio archivo bib):

  \makeatletter
  \let\saved@bibitem\@bibitem
  \makeatother

  \usepackage{bibentry}
  \usepackage{hyperref}

  \begin{document}

  \begingroup
    \makeatletter
    \let\@bibitem\saved@bibitem
    \nobibliography{database}
  \endgroup

información relacionada