1

I would like to replace 'and' with an ampersand (&) in the bibliography and in parenthetical citations.

For example, I would like the following:

In-text citation: Smith and John (2013) 
Parenthetical citation: (Smith & John, 2013) 
Bibliography: Smith, A.B. & John, C.D. (2013)

How can I do this? I've made modification to my bst file, now even the in text citation has the &.

You can view the working example fully using my overleaf account: https://v2.overleaf.com/read/ttqcqmvtxtvz

My custom .bst --> https://pastebin.com/8N3536Pj

My customthesisbib.bib -->

@Article{buczak2016survey,
  author        = {Buczak, Anna L. and Guven, Erhan},
  title         = {A survey of data mining and machine learning methods for cyber security intrusion detection},
  journal       = {Institute of Electrical and Electronics Engineers Communications Surveys and Tutorials},
  year          = {2016},
  volume        = {18},
  number        = {2},
  pages         = {1153--1176},
  __markedentry = {[Hp i7:1]},
  doi           = {10.1109/COMST.2015.2494502},
}

My minimal working example -->

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Welcome to Overleaf --- just edit your LaTeX on the left,
% and we'll compile it for you on the right. If you give
% someone the link to this page, they can edit at the same
% time. See the help menu above for more info. Enjoy!
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[11pt]{article} %reminder to add twoside command when printing
\pagestyle{plain}
\usepackage[english]{babel}
\usepackage{url}
\usepackage{hyperref}
\usepackage[longnamesfirst,semicolon]{usbib}
\renewcommand{\bibname}{Reference List}
\usepackage{ragged2e}
\setlength\RaggedRightParindent{\parindent} % default value of this parameter is `0pt`

\bibliographystyle{Custom.bst}

\begin{document}

\section*{Custom}
In this section we reference the journal article with '&' \citep{buczak2016survey}, \newline \newline
now in text with 'and' \citet{buczak2016survey}, \newline 



\bibliography{customthesisbib.bib}

\end{document}
  • Any help guys? Let me know if I need to add anything. – user2459813 Sep 3 '18 at 8:33
  • 1
    There are some problems with your bst: it gives "new.block is an unknown function---line 271 of file custombst.bst" when compiled with BibTeX. Can you provide a working bst file? – Zeping Lee Sep 4 '18 at 4:28
  • Compiles perfect for me using overleaf? Here is a link to the overleaf project.v2.overleaf.com/read/ttqcqmvtxtvz – user2459813 Sep 4 '18 at 6:04
  • @user2459813 Look into the output.blg file, the same problems are present in your overleafe project – samcarter_is_at_topanswers.xyz Sep 4 '18 at 9:30
  • 2
    @samcarter is correct. It is because overleaf uses latexmk -f to produce the pdf and thus fails to give display the error. And I am confused about your desired citation style. Since you pass option longnamesfirst to usbib and finally to natbib, the first citation of any reference, as described in the natbib documentation, is made the equivalent of the starred variant (full author list, or "Smith and John" in your example) and subsequent citations are made normal (abbreviated list, or "Smith & John" in your example). – Zeping Lee Sep 4 '18 at 10:18
1

@samcarter is correct. It is because overleaf uses latexmk -f to produce the pdf and thus fails to give display the error. And I am confused about your desired citation style. Since you pass option longnamesfirst to usbib and finally to natbib, the first citation of any reference, as described in the natbib documentation, is made the equivalent of the starred variant (full author list, or "Smith and John" in your example) and subsequent citations are made normal (abbreviated list, or "Smith & John" in your example). – Zeping Lee 50 mins ago

This comment solved my issue. I've correctly modified the .bst file myself, however, due to using the longnamefirst option it wasn't working. Removing the option and everything is perfect. Thanks

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.