5

I have been looking for a way to cite full authors with natbib. I have found some answers that I are (to me) somewhat incomprehensible, seeing that I am still a novice at Latex. So I'll ask here... I just want both the first and the last name displayed, along with the publishing year, like this: "According to John Doe (1978) one third of the moon is made of cheese, and two thirds are made of macaroni!"

I only want this displayed, whenever I choose to do so, so I don't want the first citation of a new author to be like this. I have looked through the manuals I could find for natbib, but none contained a command for this.

I trust you don't need a test document or anything, since it isn't really the case that something isn't working, just that I cannot seem to find what is in my mind, a fairly straight forward function.

lockstep
  • 250,273
Faergen
  • 531
  • 5
  • 14
  • http://tex.stackexchange.com/questions/53662/citetitle-and-citeeditor-using-the-natbib-hyperref-packages was written some time ago, since then the usebib package is available. I think it should do what you want. – Nicholas Hamilton Jun 20 '13 at 13:41

1 Answers1

4

Firstly create a dummy bibtex database having filename localbib.bib

\begin{filecontents}{localbib.bib}
    @book{  mykey,
        title = {The Title},
        year = {2013},
        author = {Doe, John},
        address = {Antarctica}
    }

\end{filecontents}

For the actual document, assuming `localbib.bib' as the database.

%Declare document class
\documentclass{article}

%Use Natbib and declare style options
\usepackage[numbers,square,sort&compress]{natbib}

%State database filename
\def\mybibtexdatabase{localbib} % <----- Change `localbib` here for your actual filename

%Import usebib package and declare the fields that can be used.
\usepackage{usebib}
\newbibfield{author} 
\newbibfield{address} 
\bibinput{\mybibtexdatabase}

%Now write the document    
\begin{document}
    %Example of usebibentry
    Example of field citation is that %
           \usebibentry{mykey}{author} is from \usebibentry{mykey}{address}, %
           the publication was made in \usebibentry{mykey}{year}\citep{mykey}

    %Existing methodology
    \citeauthor{mykey} is the standard name citation.

    %Bibliography
    \bibliographystyle{apacite}
    \bibliography{\mybibtexdatabase}
\end{document}

NOTE: In order to be able to use additional fields (ie for example doi, title, editor etc...) via the \usebibentry{KEY}{FIELD} command, a \newbibfield{FIELD} directive needs to be added to the preamble, just like it has been done ere for author and address.

  • 3
    Thank you for trying. But I have no idea what half of that does... and the thing is, if I have to write additional code for all of my references i.e. your example: \begin{filecontents}{localbib.bib} @book{mykey, title = {The Title}, year = {2013}, author = {Doe, John}, address = {Antarctica} } \end{filecontents}

    It just seems too much work instead of just writing the first name before citing. Is there no way just to add the command to natbib? I use \bibliographystyle{apacite} by the way... if it matters.

    – Faergen Jun 22 '13 at 20:36
  • That is just a dummy bibtex file entry, filecontents writes it to file firstly so it can be used as a real bibtex database. – Nicholas Hamilton Jun 23 '13 at 02:32
  • @Faergen, kindly see my updated answer. – Nicholas Hamilton Jun 23 '13 at 02:44
  • There are two problems using usebib package: 1) if you have more then one author, say author = {John Doe and Mary White and Cris Ross}, when using \usebibentry{doe2021}{author} it will produce John Doe and Mary White and Cris Ross instead of the expected John Doe, Mary White and Cris Ross; 2) it will get exactly the text field in the bib file, so it will not work as expected in other languages (translating the connecting word and). – LEo Feb 03 '21 at 18:37