Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using the bibentry package for inserting my bibitems into a CV without printing the bibliography. This works just fine until I load hyperref. Then I get the error message Lonely \item--perhaps a missing list environment. There is supposed to be a workaround (see here), which I included as deactivated in the code below. When using it, I still get the error message. Is there another solution (no biblatex please) or am I not using the workaround correctly?

\begin{filecontents}{\jobname.bib}
@Book{elvis,
    author = "Elvis Presley",
    title = "Turn Me One More Time",
    publisher = "Jail House Books",
    year = 1963,
}
\end{filecontents}
\documentclass{article}
%\makeatletter
%\let\saved@bibitem\@bibitem
%\makeatother
\usepackage{bibentry}
\nobibliography*
\usepackage{hyperref}
\begin{document}
\bibentry{elvis}
%\bibliographystyle{plain}           % works fine
\bibliographystyle{elsart-harv}     % gives an error
\nobibliography{\jobname}       % comment out when using the workaround
%\begingroup
%\makeatletter
%\let\@bibitem\saved@bibitem
%\nobibliography{\jobname}
%\endgroup
\end{document}

EDIT: Turns out, the problem is not just about bibentry and hyperref. For your convenience I replaced my actual bib-style elsart-harv with plain. It didn't come to my mind that the style could be the crux of this matter, but it obviously is.

share|improve this question
2  
Your example (plus workaround) works for me. Try to update your TeX distribution and/or delete all auxiliary files and compile again. –  lockstep Jul 31 '12 at 15:34
    
You are right. The problem lies at another point. I edited my question accordingly. –  meep.meep Aug 1 '12 at 7:34

1 Answer 1

up vote 6 down vote accepted

This seems simpler:

\begin{filecontents}{\jobname.bib}
@Book{elvis,
    author = "Elvis Presley",
    title = "Turn Me One More Time",
    publisher = "Jail House Books",
    year = 1963,
}
\end{filecontents}
\documentclass{article}
\bibliographystyle{plain}

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

\begin{document}
\nobibliography*
\bibentry{elvis}
\nobibliography{\jobname}
\end{document}

The following shows how to integrate elsarticle-harv.bst

\begin{filecontents}{\jobname.bib}
@Book{elvis,
    author = "Elvis Presley",
    title = "Turn Me One More Time",
    publisher = "Jail House Books",
    year = 1963,
}
\end{filecontents}
\documentclass{article}
\usepackage{natbib}
\bibliographystyle{elsarticle-harv}

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

\begin{document}
\nobibliography*
\bibentry{elvis}
\nobibliography{\jobname}       % comment out when using the workaround
\end{document}
share|improve this answer
    
Thanks for your help. This is surely simpler than my given code. Unfortunately, I just realized, the actual problem lies with the bibliographystyle. i edites my question accordingly. –  meep.meep Aug 1 '12 at 7:36
    
@meep.meep The elsarticle-harv.bst style requires the natbib package (I guess that elsart-harv is an obsolete version). I added a working version with the more modern style. –  egreg Aug 1 '12 at 9:19
    
Thanks a lot. Once for calling my attention to the never version and for the solution. I really was a blokhead on this one. I actually know about the need for natbib, but it slipped my mind here. –  meep.meep Aug 1 '12 at 10:23
    
I had a similar problem. I changed the style to plain and I still get the error. pdflatex compiles fine the first time, bibtex compiles fine too. The second time I run pdflatex I get the error. I am using the splitbib package. Any ideas? –  fiacobelli Mar 7 '13 at 22:04
    
@fiacobelli I guess that a new question is in order, with a M(non)WE. –  egreg Mar 7 '13 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.