1

I am trying to replace "&" with "and" in my bibliography and citations using the apalike2 style alongside the natbib package. I have tried so many solutions given here on texstackexchange but could not successfully get the desired result. I need help changing the "&" with "and". My prblem and desired output is shown in the following picture:
Problem description and desired result
Below is my MWE:

\documentclass[12pt,openany]{book}
\usepackage[ 
left=2.5cm,
right=2.5cm, 
top=3cm,
bottom=3cm,
headheight = 3\baselineskip,
headsep = 5mm,
a4paper
]{geometry}
\usepackage[table]{xcolor}
\usepackage{graphicx}
\newcommand\HRule{\noindent\rule{\linewidth}{1.5pt}}
\usepackage{background}
\backgroundsetup{contents={}}
\usepackage{fancyhdr}
\usepackage{hhline}
\pagestyle{fancy}   

\usepackage{natbib}
\bibliographystyle{apalike2}
\usepackage{etoolbox}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    citecolor=red,      
    urlcolor=yellow,
}
\usepackage{showframe}
\begin{document} 
    
    \chapter*{Acknowledgements}
    I want this citation \cite{hapa:graphenum} to be \textcolor{red}{Harary and Palmer }\textcolor{black}{(\textcolor{red}{1973})}. I want this citation \cite{Knuth94:TheTeXbook} to be \textcolor{red}{Knuth }\textcolor{black}{(\textcolor{red}{1994})}.This text is quoted from \cite{datta2017latex} should be (\textcolor{red}{Datta\textcolor{black}{,} 2017}).
    \mainmatter
    \setcounter{tocdepth}{1}

    \chapter{Introduction}
    
    \backmatter
    
    \nocite{*}
    \bibliography{references}
    
\end{document}

Below is my references.bib file

@book{hapa:graphenum,
    author =     {F. Harary and E. M. Palmer},
    title =      {Graphical Enumeration},
    publisher =      {Academic Press},
    pages={465--523},
    year =   1973
}
@book{Knuth94:TheTeXbook,
    author =     {Knuth, Donald Ervin},
    title =      {The \TeX book},
    publisher =      {Addison-Wesley Publishing Company},
    pages={465--523},
    year =   1994,
    series =     {Computers \& Typesetting A},
    address =    {Reading, MA},
    titlenote  =        {with illustrations by Duane Bibby}
}
@book{datta2017latex,
    title={LaTeX in 24 Hours: A Practical Guide for Scientific Writing},
    author={Datta, Dilip},
    pages={465--523},
    year={2017},
    publisher={Springer}
}

1 Answer 1

1

The APA is (in)famous for its usage of & in references. They do want it like this, unfortunately. The reason for this desire of making author lists like commercial companies is unknown.

Anyway, if you look into apalike2.bst in your TeX system, you will find three occurrences of \&:

    297                 { " et~al." * }
    298                 { " \& " * t * }    % changed from " and " for names -- BJR 10/5/89
    299               if$

    329                 { " et~al." * }
    330                 { " \& " * t * }    % changed from " and " for names -- BJR 10/5/89
    331               if$

   1018             { " et~al." * }
   1019             { " \& " * s #2 "{vv~}{ll}" format.name$ * } % " and " --  BJR 10/5/89
   1020           if$

Line numbers on the left are for references. You see that the original version had “and”, but it was replaced in 1989 by &.

How do you avoid the dreaded &? By not using APA based styles, first of all.

If you really need to use an old bib style such as apalike2, make a copy of apalike2.bst in your working directory, naming it apalike2-and.bst. In the copy, replace \& with and (keep all spaces intact).

Change \bibliographystyle{apalike2} into

\bibliographystyle{apalike2-and}

run LaTeX, BibTeX, LaTeX and you'll have your “and”.

The third callout about Datta should be \citep{datta2017latex}.

Full example.

\begin{filecontents*}{\jobname.bib}
@book{hapa:graphenum,
    author =     {F. Harary and E. M. Palmer},
    title =      {Graphical Enumeration},
    publisher =      {Academic Press},
    pages={465--523},
    year =   1973
}
@book{Knuth94:TheTeXbook,
    author =     {Knuth, Donald Ervin},
    title =      {The \TeX book},
    publisher =      {Addison-Wesley Publishing Company},
    pages={465--523},
    year =   1994,
    series =     {Computers \& Typesetting A},
    address =    {Reading, MA},
    titlenote  =        {with illustrations by Duane Bibby}
}
@book{datta2017latex,
    title={LaTeX in 24 Hours: A Practical Guide for Scientific Writing},
    author={Datta, Dilip},
    pages={465--523},
    year={2017},
    publisher={Springer}
}
\end{filecontents*}

\documentclass[12pt,openany]{book}

\usepackage{natbib}

\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    citecolor=red,      
    urlcolor=yellow,
}

\begin{document} 
    
I want this citation \cite{hapa:graphenum} to be 
\textcolor{red}{Harary and Palmer }\textcolor{black}{(\textcolor{red}{1973})}. 
I want this citation \cite{Knuth94:TheTeXbook} to be 
\textcolor{red}{Knuth }\textcolor{black}{(\textcolor{red}{1994})}.
This text is quoted from \citep{datta2017latex} should be 
(\textcolor{red}{Datta\textcolor{black}{,} 2017}).

\nocite{*}

\bibliographystyle{apalike2-and}
\bibliography{\jobname}
    
\end{document}

enter image description here

enter image description here

Note. I used filecontents* just to make the example self-contained and removed all unnecessary packages. You can keep your preamble and general setup, of course.

4
  • Thank you very much @egreg! It worked perfectly! No wonder why you over 1 million worth of reputation, you are the best! Out of curiosity, you said apalike2 is an old style bib style. I would like to explore the most recent bib style used for Harvard phd thesis. I saw that apalike2 is the one used in the templates as can be seen from .cls file of the Dissertate package. Am I wrong?
    – itc
    Commented Aug 8, 2022 at 10:30
  • Also, you can check from this template available on Overleaf here overleaf.com/latex/templates/…
    – itc
    Commented Aug 8, 2022 at 10:32
  • @itc It’s old, but bst files are pretty stable. You may want to have a look at biblatex, though
    – egreg
    Commented Aug 8, 2022 at 11:21
  • Thank you very much Professor @egreg. As a result of your comment, I have opened a new question tex.stackexchange.com/questions/653329/….
    – itc
    Commented Aug 8, 2022 at 12:19

You must log in to answer this question.

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