
hyperref
및 패키지를 함께 사용하면 오류가 발생합니다 bibentry
. 오류는 다음과 같습니다
./Test.bbl:1: LaTeX Error: Command \BR@bibitem already defined.
Or name \end... illegal, see p.192 of the manual.
l.1 \begin{thebibliography}{2}
물론 파일의 첫 번째 줄인 을 가리킵니다 Text.bbl
.
Test
내 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}
파일은 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}}
내가 뭘 잘못하고 있는지에 대한 제안이 있습니까? hyperref 패키지를 삭제하면 문제가 해결됩니다. 여기에서 기사를 읽었지만 제안된 솔루션은 도움이 되지 않습니다. 하나는 MWE에 있는 것으로 래핑하는 것이었습니다(사실 MWE는 그 중 하나에서 가져왔습니다) \bibentry
.NoHyper
답변1
hyperref
다른 패키지 다음에 로드하세요 .Hyperref 이전이 아닌 이후에 어떤 패키지를 로드해야 합니까?예외를 위해.
\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}
답변2
다른 패키지 다음에 하이퍼참조를 로드하는 것만으로는 충분하지 않을 수 있습니다. 그만큼하이퍼레프매뉴얼에서는 다음 해결 방법을 제안합니다(자신의 bib 파일로 "데이터베이스" 변경).
\makeatletter
\let\saved@bibitem\@bibitem
\makeatother
\usepackage{bibentry}
\usepackage{hyperref}
\begin{document}
\begingroup
\makeatletter
\let\@bibitem\saved@bibitem
\nobibliography{database}
\endgroup