8

Basically I have the same issue as in here:

Suppress printing of only \bibentry references with natbib?

I want to be able to use the characteristics of bibentry (i.e., I want to print the full citation inside my document and at the same time I want to have a bibliography with all the elements of my .bib file (it's easier to just see the question I pointed above).

The thing is that the answer provided is using biblatex. I don't need much convincing to switch to it, but for several reasons (mainly "political") I have to use natbib.

Any suggestions?

Edit

I've recently tried the answer provided by Karl, but it doesn't seem to work while building the whole project in TeXnicCenter (MikTeX 2.9). Here is my code (it's the same as Karl's, but the References file is sepparate and has exactly the same content as Karl's example):

\documentclass{article}
\usepackage{natbib}
\usepackage{bibentry}
\nobibliography*

\begin{document}

\section{Test}

This is a citation \citep{art1}

\section{Test}

This is a bibentry

\begin{enumerate} \item \bibentry{book1} \end{enumerate}

\nocite{*} \bibliographystyle{apalike} \bibliography{References} \end{document}

Mario S. E.
  • 18,609

1 Answers1

5

I'm not sure to understand correctly your needs, but try the example below:

\documentclass{article}

\begin{filecontents}{examplebib.bib}
@article{art1,
author="First Last",
title="A fictitious journal article",
year=1900,
journal="Journal of nothingness",
volume=2,
pages="1-2"
}

@book{boo1,
author="Respectable Writer",
title="A silly book",
year=2000,
publisher="PublishCo",
address="Somewhere"
}
\end{filecontents}

\usepackage{natbib}
\usepackage{bibentry}
\nobibliography*

\begin{document}

\section{Test}

This is a citation \citep{art1}

\section{Test}

This is a bibentry

\begin{enumerate}
\item \bibentry{art1}
\end{enumerate}

\nocite{*}
\bibliographystyle{apalike}
\bibliography{examplebib}
\end{document} 

Output:

enter image description here

karlkoeller
  • 124,410
  • 1
    If you read the linked question, I think Mario wants any entry used as a \bibentry to not appear in the list of references. – Alan Munn Oct 27 '13 at 16:11
  • @AlanMunn no no, this is exactly what I wanted, but it doesn't seem to work when I implement it the way I'm using it (I want it to be inside a .sty) – Mario S. E. Oct 27 '13 at 16:12
  • I was wondering if there isn't any other workaround, like trying to implement the \bibentry command... – Mario S. E. Oct 27 '13 at 16:16
  • @MarioS.E. Take a look at bibentry.sty and see if you can somehow extract its definition. – karlkoeller Oct 27 '13 at 16:30
  • 1
    @MarioS.E. So then I truly don't understand your question. You'll need to explain how Karl's solution doesn't work for you. (And the linked question is a bit of a red herring anyway, since the requirements there are different.) – Alan Munn Oct 27 '13 at 16:32
  • @AlanMunn It's quite complicated (and I'm afraid it's one of the limitations ot TeX.SE) that when a LaTeX rookie like me tries to play developer encounters problems that do not occur in a MWE. What I'm really trying to do is to improve my thesis template package (feupphdteses) in order to be able to print a "publications" page at the beginning containing the author's own publications while doing his/her thesis. – Mario S. E. Oct 27 '13 at 16:48
  • @AlanMunn I actually thought that using bibentry would solve my issue, but somehow something is going wrong, and I'm not sure where. That's why I asked the question, to be completely sure I was implementing it the right way (at least in a MWE context). Unfortunately, even by following all the steps presented by Karl (i.e., loading bibetry after natbib and writing \nobibliography* right after it I still get errors – Mario S. E. Oct 27 '13 at 16:53
  • This solution doesn't work when using TeXnicCenter and building a project. It only works as an unique file. – Mario S. E. Nov 01 '13 at 19:37