0

I would like to make author's name, year and citation index/number every time I make a reference. I found useful this question, from which I take my example:

Make \cite{my reference} show name and year

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) [1]

I there a way to do it? I would like also to have the possibility to switch from one to other citation style within the text.

Barbab
  • 153
  • Are you using biblatex as the tag suggests or a BibTeX-based bibliography (as in the linked question)? Which bibliography style and citation style (settings) do you use? – moewe Jan 03 '22 at 15:34
  • In a numeric style, both natbib (via \citet) and biblatex (via \textcite) would allow you to obtain "Franklin [1]" without any further modification. (Do you really need the year?) – moewe Jan 03 '22 at 15:35
  • @moewe I edited my question tags. I would like to obtain "Franklin [1]" or "Franklin (1999)" or "Franklin (1999) [1]" with different commands. – Barbab Jan 03 '22 at 15:38
  • I don't think I understand. Do you want to be able to produce all the three formats you listed in your previous comment with different commands. Or would one of the three be sufficient? As mentioned above, if you use natbib \citet will produce "Franklin [1]" (in numeric styles) or "Franklin (1999)" (in author-year styles) and \citep will produce "[1]" (numeric) or "(Franklin, 1999)" (author-year), provided you use a compatible bibliography style (e.g. plainnat). – moewe Jan 03 '22 at 15:49
  • With \citet I get the same as with \cite that is "Franklin (1999)". With \citep i get "(Franklin, 1999)". Let say that I want to add to each of the citations the "[1]". Is is possible? – Barbab Jan 03 '22 at 15:54
  • Not easily, no. But in an author-year style it makes little sense to additionally put a number. The work is already uniquely identified by the author-year label (at least if the style is sound). In fact adding the (then necessary) numbers in the bibliography can make it harder to spot author and year making the author and year effectively redundant. – moewe Jan 03 '22 at 16:00
  • https://www.mdpi.com/2227-7390/7/5/406 in this paper they use sometimes the autor name, sometimes only the number and sometime both. I would like to do the same. – Barbab Jan 03 '22 at 16:06
  • Well, it is obviously not impossible to do this. With natbib you could use a combination of \citeauthor, \citeyearpar and \citep if you use a numeric style. The question is whether that is much better than just a numeric style with \citet. (With numeric style I mean something like \usepackage[numbers]{natbib} such that the bibliography shows numbers.) Note that throwing together several \cite... commands needs care if you want to cite multiple sources at once and if you want to deal with pre- and post-notes properly. You usually end up with something not particularly elegant. – moewe Jan 03 '22 at 16:17

0 Answers0