BibTeX, biblatex and biberhow to change "and" to "&" in latex

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
waterinus
Posts: 8
Joined: Thu Mar 05, 2015 12:33 am

how to change "and" to "&" in latex

Post by waterinus »

So in my bibliography and the text, the citing is like this, (Watson and Smith, 2001), I want to change it to (Watson & Smith, 2001). I am pretty new to the bibliography and using the Columbia University latex template, so I'm hoping this would not be very complex.
Thank you in advance!

Code: Select all

\usepackage{cite}
\usepackage{natbib}
\usepackage{apalike}

\begin{Bibliography}

\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{refs}
\bibliographystyle{apalike} 
\end{Bibliography}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to change "and" to "&" in latex

Post by Johannes_B »

Please provide a minimal working example that lets us reproduce citing and bibliography.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
waterinus
Posts: 8
Joined: Thu Mar 05, 2015 12:33 am

Re: how to change "and" to "&" in latex

Post by waterinus »

dear Johannes, I've used this template from Columbia Computer Science Department
http://www.cs.columbia.edu/education/phd/faqs/defending
please take a look, whenever I need to cite something, i just need to type \citep{keywords} to do the trick, everything else is fine, except that the citation format should be (Watson & Smith, 2001) other than (Watson and Smith, 2001).

I'm not sure if i'making myself clear when asking the question, but I DO understand an example will help diagnose the problem, but there is no example, just the template ( I use bibtex to import the references) Thank you again so much
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to change "and" to "&" in latex

Post by Johannes_B »

The template provided by the university ships with an old file from LaTeX2.09 which went obsolete in 1994 to deal with citations. PLease consult your advisors if this should be used. The template itself is pretty outdated and shouldn't be considered good style. Updating templates, or even using them, is hard.

To change the word and to an ampersand, we need to change the bibliography style. You have chosen apalike, the template uses named. I have attached the modified style.

Code: Select all

\documentclass{report}
%\usepackage{cite}%don't use this, you get an error
\usepackage{natbib}
\usepackage{apalike}
\begin{document}
\citep{Grosz_and_Sidner_1986}
\cleardoublepage
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{refs}
\bibliographystyle{waterinus}
\end{document}
Please check with your advidors or submission office.
Attachments
waterinus.bst
(24.16 KiB) Downloaded 834 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
waterinus
Posts: 8
Joined: Thu Mar 05, 2015 12:33 am

Re: how to change "and" to "&" in latex

Post by waterinus »

Dear Johannes, Thank you so much! The graduate school of art and sciences said it is ok to use this template, although it is really difficult to use. I'm pretty much done with all the hard part except for this one last major problem, so i probably will keep it.
Your bst file solve the problem in the actual text, but the Bibliography section is still the same (and, not ampersand).
Attachments
Screen Shot 2015-05-05 at 3.47.35 PM.png
Screen Shot 2015-05-05 at 3.47.35 PM.png (31.04 KiB) Viewed 13691 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to change "and" to "&" in latex

Post by Johannes_B »

I didn't even look at the bibliography. :-)

Doing bibliographies with the old BibTeX system and bst-files is quite hard, even for me as an experienced user. The modern combo of biblatex and biber can do stuff like that using simple LaTeX macros. Still not that easy, especially not for a beginner, but once you got a bit of supporter, you can add the change to the preamble of the document. No need to rename files and look at date and copyright statements.

Attached the updated file, it should print duck instead of and now. ;-)
Attachments
waterinus.bst
(24.18 KiB) Downloaded 1049 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
waterinus
Posts: 8
Joined: Thu Mar 05, 2015 12:33 am

Re: how to change "and" to "&" in latex

Post by waterinus »

This \& solve the problem!
Thank you so much!
Post Reply