# Bibentry and duplicate identifiers

I have previously written about listing your publications before the bibliography. This works fine, but there is one problem in combination with document-internal links: An anchor is created at the point where you insert the bibentry. This means that if you click on a citation in the text, you will skip to this location instead of the literature list in the end of the work. Also, you will get errors like this:

l.258 ...a and Blubb, 2014]{BlaBlubb2014}
pdfTeX warning (ext4): destination with the same identifier
(name{cite.BlaBlubb2014}) has been already used, duplicate ignored


The solution is pretty simple, wrap your bibentry-list in a NoHyper environment (HT J-P’s answer at stackexchange):

\begin{NoHyper}\bibentry{BlaBlubb2014}\end{NoHyper}


# List your publications before the bibliography

Usually, in academic texts you cite stuff and at the end there is the bibliography that contains the full entries for all things referenced in the text. But there are some situations where you want to list some complete bibliography entries beforehand, somewhere in the text. For example you may want a list of prior work somewhere near the beginning of a grant proposal or a list of things published during the grant period somewhere at the end, but separate from the bibliography. Of course, you can write this list by hand, but where would be the fun in that?

And of course there is a LaTeX package for that, bibentry. You include the package with your bibliography style in the preamble. You can include it together with natbib.

\bibliographystyle{apalike} % or any other style you like
\usepackage{natbib} % optional, but combination is possible
\usepackage{bibentry}


Then, also in the preamble, you "turn off" the regular bibliography with \nobibliography. After that you can create your list of stuff somewhere in the document, but you will not have a bibliography at the end. Which is probably not what you want. So to additionally be able to include the references in the usual way, use this snippet:

\nobibliography*
\let\oldthebibliography=\thebibliography
\let\endoldthebibliography=\endthebibliography
\renewenvironment{thebibliography}[1]{%
\begin{oldthebibliography}{#1}%
\setlength{\parskip}{0ex}%
\setlength{\itemsep}{0ex}%
}%
{%
\end{oldthebibliography}%
}


The citing commands (\cite, \citep, etc.) and what they produce are unchanged, but now you can use \bibentry at any point in the text to create the full bibliographic entry. The formatting will be the same as for the references in the bibliography:

Parts of this work have been published in: \bibentry{Kessler2014}


# LaTeX citations as used in the NLP community

If you read NLP literature, you will find literature refernces of the form “The first work on this task was done by Smith and Miller (2006). Similar techniques are used in information retrieval (Doe and Norman, 2010).”

This is quite different from what LaTeX usually provides – numbered citations like [1] with ‘plain’ or cryptic letter-number combinations like [SM06] with ‘alpha’. The closest you can get out of the box is ‘apalike’ which would give you [Smith and Miller, 2006].

So what to do?

1. Option: Use a bibliography style provided by some NLP conference, e.g., from NAACL 2013. They will generally offer \newcite to get Smith and Miller (2006) and \cite to get (Doe and Norman, 2010).

2. Option: Use natbib which offers \cite to get Smith and Miller (2006) and \citep to get (Doe and Norman, 2010). Additionally, natbib can do much more, e.g., you can add text into the parenthesis.

Minimal example:

\documentclass[a4paper]{scrartcl}
\usepackage{natbib}
\bibliographystyle{apalike}
\begin{document}
The first work on this task was done by \cite{SmithMiller2006}.
Similar techniques are used in information retrieval \citep{DoeNorman2010}.
\bibliography{literatur}
\end{document}


So, why not use both, some aclstyle and natbib together? Well… they are not compatible (or at least I was not able to make it work).