2

I'm having two main problems with my master thesis citations. I’m using JabRef for building my bib file.

For example I have the following authors in the bib file:

1.

Author  = {{Silva, Peter}},
Year = {2009},

2.

Author  = {{Cash, John and Lucas, George and Noah, Steve }},
Year = {2012},

Problem 1:

In the master thesis, text each time I want to cite one author I would like the format to be: last name (year). For the first case it would show: Silva (2009).

At the end of the thesis when the full bibliography is listed it would show: Silva, Peter, 2009.

Problem 2:

In the master thesis, text each time I want to cite more than two authors I would like the format to be: last name of first author et al. (year). For the second case it would show: Cash et al. (2012).

At the end of the thesis when the full bibliography is listed it would show: Cash, John and Lucas, George, and Noah, Steve, 2012.

  • Welcome to TeX.SX! The problem is due to the additional pair of braces around the author names: it should be ` Author = {Silva, Peter}` and Author = {Cash, John and Lucas, George, and Noah, Steve} – egreg Jun 17 '15 at 23:05
  • HI! Thank you very much for your help and welcome greetings! You’re right. That’s the way I used to have it, but that way when the bibliography is listed I get: Peter Silva, 2009 and not Silva, Peter, 2009 like is showed during the citations. The citation list will not be alphabetically ordered. – Joao Jun 17 '15 at 23:22
  • Are you using the old system with natbib and others, or the modern biblatex? Can you provide a minimal working example so that we see your setup and can provide more specific help? – Johannes_B Jun 17 '15 at 23:31
  • @Johannes_B - Given that the OP has stated in the title that he/she is using the plainnat bibliography style, I'd say it's fairly straightforward to infer that BibTeX and the natbib package are being used. However, this inference could be wrong... – Mico Jun 18 '15 at 0:12
  • @Mico Sorry, i wasn't given this enough attention. – Johannes_B Jun 18 '15 at 0:15
2

As you've confirmed in a comment, implementing @egreg's suggestion and getting rid of the extra pair of curly braces around the author fields (and around the editor fields too, while you're at it) lets LaTeX and BibTeX generate the desired citation call-out format.

To address the second issue -- listing the authors' full names as "Surname, FirstName" rather than as "FirstName Surname" -- it's necessary to modify the bibliography style file slightly. Fortunately, the required modification is straightforward.

  • Start by finding the file plainnat.bst on your system. (If you have TeXLive or MikTeX, typing "kpsewhich plainnat.bst" at a command prompt should tell you where the file is located.) Make a copy of this file, and name the copy (say) revplainnat.bst.

  • Open revplainnat.bst in a text editor, and find the function format.names. (It starts on line 216 in my copy of the file.)

  • A few lines down from the start of the function, locate the instruction

        { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
    
  • Change this string to

        { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
    

    You can probably guess what moving ff from the start to the end of the nameptr string does.

  • Save the file revplainnat.bst, either in the directory where your main tex file is located or in a directory that's searched by BibTeX. If you choose the second method, be sure to update the filename database of your TeX distribution.

  • Start using the new bibliography style by replacing \bibliographystyle{plainnat} with \bibliographystyle{revplainnat} and re-running LaTeX, BibTeX, and LaTeX twice more to fully propagate all changes.

Happy BibTeXing!


enter image description here

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{newtest.bib}
@misc{pub1,
  Author = {Silva, Peter}, 
  Year   = {2009},
}
@misc{pub2,
  Author = {Cash, John and Lucas, George and Noah, Steve }, 
  Year   = {2012},
}
\end{filecontents}

\usepackage[authoryear]{natbib}
\bibliographystyle{revplainnat}

\begin{document}
\cite{pub1}

\cite{pub2}

\bibliography{newtest}
\end{document}
  • Hi Mico! Thank you so much for you detailed and precise instructions! I had to delete all the files compiled by LaTeX @ the main file directory and it worked like a breeze! So many time I lost with this issue… You’re 5*! – Joao Jun 18 '15 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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