51

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}
lockstep
  • 250,273
Akavall
  • 799
  • 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

5 Answers5

36

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 07 '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 – Nathan majicvr.com Nov 02 '19 at 03:14
  • This helped me, thanks – abdoulsn Dec 30 '19 at 15:46
  • For completeness, there are also \citetitle, \citedate, and \citeurl. – Hendrikto Nov 19 '21 at 17:28
  • @Arnaud - SparkandShine's suggested solution -- to use the apalike bib style instead of plainnat -- is incomplete in the sense that it, too, requires loading a suitable citation management package. One such package could be apalike (yes, the package name and the bib style name are the same), and another one is -- you guessed it, natbib. That is why I had raised the question, a bit more than seven years ago, if using apalike instead of plain or plainnat really was the "simplest way". – Mico Dec 24 '23 at 15:58
  • @Mico I got confused because in the accepted answer there is usepackage{natbib}. The way it is redacted strongly suggests painnat cannot be used without natbib. I just tested: it can. – Arnaud Dec 25 '23 at 16:19
  • @Arnaud - I guess it comes down to one's choice of the meaning of the phrase "cannot be used". If the objective is merely to compile the document without throwing an outright syntax error, then \cite will indeed "work" -- and thus "can be used" -- even if natbib isn't loaded. However, if the typesetting objective is a tad more ambitious, such as wanting to generate a decent-looking authoryear-style citation call-out, then I don't see a way around loading natbib when using plainnat. That said, I really don't understand your apparent aversion to loading natbib. – Mico Dec 25 '23 at 18:32
  • @Mico I have absolutely no aversion to loading natbib ;-) Just trying to figure out things. – Arnaud Dec 26 '23 at 16:56
30

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}
Mico
  • 506,678
  • 1
    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.http://tex.stackexchange.com/questions/135668/what-is-the-proper-bibliography-format-to-use-with-natbib – Akavall Sep 29 '13 at 20:13
  • 8
    @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
  • Note that plainnat works even if you do not load package natbib: natbib is a way to improve even more the result. – Arnaud Dec 25 '23 at 16:21
  • @Arnaud - I'm afraid I have to disagree with your claim. natbib is not just a way to "improve" the look of the citation call-out. Indeed, I'd say that loading natbib is essential to making the output of \cite presentable. To wit, if natbib isn't loaded, \cite{Franklin1999} produces [Allen and Karjalainen(1999)]; I strongly doubt that most readers would find this acceptable. – Mico Dec 25 '23 at 18:29
  • @Mico That's strange, I tried yesterday and could not see any difference, maybe I made a mistake during compilation. – Arnaud Dec 26 '23 at 16:54
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

Sean Allred
  • 27,421
  • 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 http://tex.stackexchange.com/questions/14045/a-biblatex-style-thats-like-plainnat 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 09:29
  • 1
    @Mico looks like just a silly mistake :-) – Sean Allred Jul 13 '17 at 14:16
2

I did not want to switch to natbib, so I made a workaround, using info from: https://ctan.joethei.xyz/info/biblatex-cheatsheet/biblatex-cheatsheet.pdf

\citeauthor*{example_1}
\citeyear{example_1}

or

Author, year \nocite{example_1}

will do the trick while using bibtex with biber.

Roland
  • 6,655
  • 1
    Can't you just load a different style: style=authoryear, and use \autocite as normal? Usually it should not be necessary to go for constructions like \citeauthor*{example_1 \citeyear{example_1} and solutions like this can have issues (try citing two works by the same author from the same year). – moewe Aug 31 '21 at 14:54
  • You could, but then it would change the behaviour throughout the document. I wanted to show ho it could be done as an exception, when you want to mention for example just the author/year when discussing their results. In those cases: "Where [1] showed that ..." just does not look as good as "Where Mr. Author, 2000, showed that ..." – C_hazard_H Sep 02 '21 at 09:57
  • In that case I'd use Where \textcite{sigfridsson} showed that .... \textcite is defined in all biblatex standard styles and most contributed standard styles and is generally meant to be used for exactly these narrative citations. – moewe Sep 02 '21 at 11:44
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)

Stefan Pinnow
  • 29,535
  • 2
    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 06:07