[Tex/LaTex] Prevent ibid tracking in natbib

bibtexnatbib

I want to prevent natbib from replacing a list of author names by a long dash, which is the default behavior for citations with the same authors. Why? Because I'm using \bibentry to place full citations in a CV and actually want the full citation.

I'm using packages bibentry, natbib and the amnatnat.bst style.

First post, sorry for the lack of fancy formatting, links, etc…

UPDATE: Can I modify the following function in amnatnat.bst to prevent the substitution?

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname := s }
     { s oldname =
         { "---{}---{}---" }
         { s 'oldname := s }
       if$
     }
   if$
}

Best Answer

Unfortunately it cannot be done with amnatnat.bst. When you run bibtex amnatnat.bst replaces the author lists with ---{}---{}--- if the authors list in the entry bibtex is currently processing in the same as the previous one, and the information about the authors (full) names is lost. Thus the only alternative I see is to change the \bibliographystyle.

If you want to keep the dash for repeated authors in the bibliography and using the full citation in the text, a possible solution is to use biblatex and to use the \fullcite{<key>} command instead of \bibentry{<key>.

EDIT

The simplest way to modify the function in amnatnat.bst is to replace definition of the FUNCTION {name.or.dash} with

FUNCTION {name.or.dash}
{ skip$ }

This would produce a "standard" entry wihtout the dash for repeated names (both in the bibliography and in \bibentry.

If one wants to have both the full references with \bibentry{<key>} and the dash in the bibliography the function can be modified as follows:

FUNCTION {name.or.dash}
{ 's :=
   oldname empty$
     { s 'oldname := s }
     { s oldname =
         { "\andash{" oldname * "}" * }
         { s 'oldname := s }
       if$
     }
   if$
}

and then using the following code in the LaTeX source

\usepackage{etoolbox}
\newcommand{\andash}[1]{#1}
\AtBeginEnvironment{thebibliography}{\renewcommand{\andash}[1]{---{}---{}---}}
\AtEndEnvironment{thebibliography}{\renewcommand\andash[1]{#1}}

The following is an MWE illustrating the usage:

\documentclass{article}
\usepackage{natbib}
\usepackage{bibentry}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Article{first,
  author = "Last, First",
  title = "First Title",
  journal = "Journal Name",
  year = 2012
}
@Article{second,
  author = "Last, First",
  title = "Second Title",
  journal = "Journal Name",
  year = 2011
}
@Article{third,
  author = "More, First",
  title = "Third Title",
  journal = "Journal Name",
  year = 2011
}
\end{filecontents}

\usepackage{etoolbox}
\newcommand{\andash}[1]{#1}
\AtBeginEnvironment{thebibliography}{\renewcommand{\andash}[1]{---{}---{}---}}
\AtEndEnvironment{thebibliography}{\renewcommand\andash[1]{#1}}

\begin{document}
Testing normal citations
\cite{first} 
\cite{second}
\cite{third}

\bibliographystyle{amnatnat}
\nobibliography{\jobname}

Testing \verb|\bibentry|

\bibentry{first}

\bibentry{second}


\bibliography{\jobname}

\section*{More Testing}
Testing \verb|\bibentry| again after the bibliography

\bibentry{second}

\bibentry{first}

\end{document}

PS Comment one of the \bibliography, \nobibliography before running bibtex.

Related Question