21

I am trying to figure out how to make author's name and year show up every time I make a reference.

For example:

my_bibtex.bib has this entry:

@article{Franklin1999,

author = {Franklin Allen and Risto Karjalainen},
title = {Using genetic algorithms to find technical trading rules},
year = {1999},
volume = {51},
pages = {245-271},
journal = {Journal of Financial Economics}

}

If in my_paper.tex I use this line:

Important result has been found by \cite{Franklin1999}

My output looks like:

Important result has been found by [1]

But I want it too look like:

Important result has been found by Franklin 1999

I there a way to do it?

My bibliographystyle is set to plain

\bibliographystyle{plain}

\bibliography{my_bibtex}
  • 4
    The plain bibliography style isn't easily adapted to authoryear-style citations. Better to use the plainnat bibliography style, the natbib package (load it with option authoryear), and commands such as \citet and \citep ("textual" and "parenthetical" citations -- macros provided by the natbib package). – Mico Sep 29 '13 at 18:44
  • 3
    Probably »biblatex« would be a suitable option here. – Thorsten Donig Sep 29 '13 at 18:50
14

Here's a solution that uses the natbib citation management package and the plainnat bibliography style. (Note that the plain bibliography style is not well-suited for authoryear-style citations.) As always, run latex, bibtex, and latex twice more to generate the bibliography and compile the document.

enter image description here

\documentclass{article}
\usepackage[round]{natbib}   % omit 'round' option if you prefer square brackets
\bibliographystyle{plainnat}
\begin{document}
\citet{Franklin1999}
\bibliography{my_bibtex}
\end{document}
  • Thank for your answer, for some reason when I run your code. I get this error: ! Package natbib Error: Bibliography not compatible with author-year, I asked another question about it, about the same time you posted this answer: citations.tex.stackexchange.com/questions/135668/… – Akavall Sep 29 '13 at 20:13
  • 7
    @Akavall - When switching from one bibliography style to another, e.g., from plain to plainnat, it's prudent to wipe out all auxiliary files (including the .aux and .bbl files) prior to rerunning latex/bibtex/latex/latex. Please check if deleting the previous batch of auxiliary files does the trick. – Mico Sep 29 '13 at 20:17
16

The simplest way is to use the bibliography style: apalike, instead of plain. Here is:

\bibliographystyle{apalike} 
\bibliography{References}

A more powerful package is natbib. In your case, use citet for textual citations.

\usepackage{natbib}

\citet     #textual citations, print the abbreviated author list
\citet*    #textual citations, print the full author list

\citep     #parenthetical citations, print the abbreviated author list
\citep*    #parenthetical citations, print the full author list

\citealt    #the same as \citet but without any parentheses.
\citealp    #the same as \citep but without any parentheses. 


\citeauthor{ale91}         #Alex et al.
\citeauthor*{ale91}        #Alex, Mathew, and Ravi

\citeyear{ale91}           #1991 
\citeyearpar{ale91}        #(1991)
  • 1
    A little bit late to ask this question, but I'll do so anyway: Why is using the apalike bibliography style the "simplest way"? E.g., in what sense might using the apalike style be simpler than using the plainnat style? – Mico Dec 7 '16 at 11:48
  • My tex does not print the abbreviated author list with \citep, it instead prints the full list. why? – osk Feb 16 '18 at 22:43
  • +1 to what Mico asked – frank Nov 2 at 3:14
2

What you probably want is something like the authoryear citation style of the biblatex package. If you are trying to follow a particular citation style, it would be best to say which in your original question; a biblatex style likely exists for it.

To compile this example, run

pdflatex my_paper
biber my_paper
pdflatex my_paper
pdflatex my_paper

my_paper.tex:

\begin{filecontents*}{my_bibtex.bib}
@article{Franklin1999,
        author = {Allen Franklin and Karjalainen Risto},
         title = {Using genetic algorithms to find technical trading rules},
          year = 1999,
        volume = 51,
         pages = {245--271},
  journaltitle = {Journal of Financial Economics}
}
\end{filecontents*}
\documentclass{article}
\usepackage[style=authoryear]{biblatex}

\addbibresource{my_bibtex.bib}

\begin{document}
Important result found by~\cite{Franklin1999}.
\printbibliography
\end{document}

output

  • Is there a ready-made biblatex style that emulates the "classic" plain (or plainnat) bibliography style? – Mico Sep 29 '13 at 20:10
  • @Mico I believe just leaving the style as the default (numeric) does this, but I would take a look at tex.stackexchange.com/questions/14045/… as well (in case I don't understand what you're asking) – Sean Allred Sep 29 '13 at 20:28
  • Thanks. I've checked out the answers you've linked to. It would appear that the option FirstInits=true, stated in the second answer, may not be a correct implementation of the plainnat style. By the way, the default look of biblatex's authoryear setup doesn't look all that close to that of plainnat either. (For the record, I actually prefer the look produced by biblatex!) – Mico Sep 29 '13 at 20:43
  • Just out of idle curiosity: Why did you transpose the first and last names of the first author? The person's name really is "Franklin Allen", not "Allen Franklin". The author field provided by the OP was correct... – Mico Jul 13 '17 at 9:29
  • 1
    @Mico looks like just a silly mistake :-) – Sean Allred Jul 13 '17 at 14:16
-1

plainnat is a better option I think

I use,

\usepackage{natbib}

\Mycite[1]{(\citeauthor{#1}~(\citeyear{#1}))}
.
.
.
\bibliographystyle{plainnat}
\bibliography{referencesfile}
.
.
.

and the result looks

Peng and Chen (2015)

  • 1
    Welcome to TeX.SX! The plainnat style is also recommended by the accepted answer, so could you please highlight which improvement your answer makes? – TeXnician Jul 31 '18 at 6:07

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.