1

Do you know how I can change the author separator in citation call-outs from "and" to "&", i.e. such that it yields "author1 & author2 [YEAR]" instead of "author1 and author2 [YEAR]"?

I use the natbib citation management package.

You can find my current code below (I have the citation code saved in separate bib file, hence I did not include it in my code below).

Many thanks in advance.

Sincerely,

Your daily_dose

My current code looks as follows:

\documentclass{article}
\usepackage[comma]{natbib}
    \setcitestyle{square}
    \renewcommand{\refname}{Bibliography}
    \setlength{\bibsep}{2pt plus 0.3ex}

\title{Title}
\author{Author}
\date{\today}

\begin{document}
\maketitle

As an example, I use \cite{KahnemanTversky1979}, \\
which should yield Kahneman \& Tversky [1979] \\
instead of Kahneman and Tversky [1979].

Does anybody know how I can change the separator for two authors from "and" to "\&"?

\bibliographystyle{ecta}
    \bibliography{bibliography}

\end{document}
5
  • Welcome to TeX.SE.
    – Mico
    Oct 21, 2021 at 19:05
  • Do you want to have & show up just in the citation call-outs, or in the formatted bibliographic entries as well?
    – Mico
    Oct 21, 2021 at 19:13
  • 1
    Hi Mico and thanks for the kind welcome. I just want to have it in the citation call-out.
    – daily_dose
    Oct 22, 2021 at 12:46
  • Please see the answer I just posted.
    – Mico
    Oct 23, 2021 at 9:17
  • 1
    Thanks Mico, your answer worked wonders! Also thanks for the prompt support and take care :)
    – daily_dose
    Oct 26, 2021 at 11:05

1 Answer 1

1

I suggest you proceed as follows.

  • Find the file ecta.bst in your TeX distribution. Make a copy of this file and call the copy, say, ecta-ampersand.bst. (Do not edit an orginal, unrenamed file of the TeX distribution directly.

  • Open the file ecta-ampersand.bst in a text editor. The program you use to edit your tex files should do fine.

  • Inside ecta-ampersand.bst, locate definition of the function bbl.and. (In my copy of this file, the function definition starts on l. 228. It should look like this:

    FUNCTION {bbl.and}
    { "and"}
    
  • Immediately below this function definition, insert the following code to define a function called bbl.ampersand:

    FUNCTION {bbl.ampersand}
    { "\&"}
    
  • Next, locate the function called format.lab.names in the bst file. (Aside: "lab" is short for "label"; the function creates the string that's used in authoryear-style citation call-outs.) Inside this function, find the following code line:

                { bbl.and space.word * s #2 "{vv~}{ll}" format.name$
    

    In this line, change bbl.and to bbl.ampersand.

  • Save the bst file, either in the directory where the main tex file is located or in a directory that's searched by BibTeX. If you choose the second option, be sure to update the filename database of your TeX distribution suitably. If you're not sure how to execute the preceding instruction, I suggest you choose the first option.

  • In your main tex file, change \bibliographystyle{ecta} to \bibliographystyle{ecta-ampersand}. Then, perform a full recompile cycle: LaTeX, BibTeX, and LaTeX twice more.

Happy BibTeXing!


Here's an MWE (mininum working example) that puts all of this together.

enter image description here

\documentclass{article}

\begin{filecontents}[overwrite]{mybib.bib}
@article{kt79,
  author  = "Kahneman, Daniel and Tversky, Amos",
  year    = 1979, 
  title   = "Prospect Theory: An Analysis of Decision under Risk",
  journal = "Econometrica",
  volume  = 47,
  number  = 2,
  pages   = "263–291",
}
\end{filecontents}

\usepackage[comma,square]{natbib}
\bibliographystyle{ecta-ampersand}
\renewcommand{\refname}{Bibliography}
\setlength{\bibsep}{2pt plus 0.3ex}

\begin{document}
\noindent
\citet{kt79}
\bibliography{mybib}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .