7

For my dissertation I want to use the Harvard referencing style. So in my document I have a line as follows;

The most important paper published in relation to NLP Transformers is \citep{aiayn}

and in my .bib file I have;

@misc{aiayn,
     author="Ashish Vaswani et al",
     year=2017,
     title="Attention is all you need",
     url="https://arxiv.org/abs/1706.03762" }

When I compile my document I only see "et al". I do not see the author's name. How do I fix this?

If I put in "and", "and" also gets displayed. If I put in a comma after the name, only the name gets displayed. I want to see

Ashish Vaswani et al

in the formatted bibliographic entry.

5
  • You could try author={Vaswani, Ashish and et al.}, but this should only be a workaround, as in your .bib-file all authors should be noted (as far as i know) and let biber handle the splitting of how many authors are mentioned in your paper. A complete MWE (a minimal wokring example) could be helpful for this! How do you produce your .bib-file (I am curious because of the use of "-quotes instead of curly braces)?
    – Lukas
    Sep 13, 2021 at 9:13
  • Do note that this is actually a scientific paper, i.e. it is more appropriate to use the @article type for citation, @misc should always ever be an emergency solution. And as the previous comment points out, BibTeX (and the more superior alternatives BibLaTeX and Biber) will be able to automatically shorten a list of several authors to et al. (Also, not the point after al as it is an abbreviation!
    – Markus G.
    Sep 13, 2021 at 10:02
  • 1
    @Lukas Using quotation marks instead of curly braces is acutally prefered by some users, as then the curly braces denote only the entire entry. There are some minor differences in how to use the two notations, but for all intents and purposes they are equivalent.
    – Markus G.
    Sep 13, 2021 at 10:03
  • 1
    @Lukas - The method recommended by BibTeX is to write author={Vaswani, Ashish and others}. The word "others" is treated as a key value.
    – Mico
    Sep 13, 2021 at 11:05
  • @MarkusG. - Your claim that "this is actually a scientific paper, i.e. it is more appropriate to use the @article entry type" isn't quite right. Just because a publication qualifies as a scientific paper does not imply that one assign it the @article entry type. Indeed, the @article entry type should be used exclusively for pieces published in scholarly journals. The fact that the field journaltitle is missing for the entry in the answer you posted is a dead give-away that something's amiss. In short, for the entry at hand, there's nothing wrong with using the @misc entry type.
    – Mico
    Sep 14, 2021 at 11:27

2 Answers 2

8

Here is an example of how to do this:

\documentclass{article}
\usepackage[backend=biber,maxnames=1]{biblatex}

\begin{filecontents}{bibliography.bib}
@article{vaswani2017,
    title={Attention Is All You Need}, 
    author={Ashish Vaswani and Noam Shazeer and Niki Parmar and Jakob Uszkoreit and Llion Jones and Aidan N. Gomez and Lukasz Kaiser and Illia Polosukhin},
    year={2017},
    eprint={1706.03762},
    archivePrefix={arXiv},
}
\end{filecontents}

\bibliography{bibliography.bib}

\begin{document}
    This is a line of text \cite{vaswani2017}
    
    \printbibliography
\end{document}

Which outputs this: enter image description here

Do take note that the backend in this case is not bibtex but biber, which is more modern. The biblatex package has many more options, including style options that will take care of the details of your References section.

Also, of course your .bib file can be produced independetly, the inclusion using filecontents is just for demonstration purposes.

1
  • Thank you for that Marcus. Especially for going to the trouble of writing the full citation for me, very helpful given I am in a rush!
    – arame3333
    Sep 13, 2021 at 10:29
11

Assuming you employ BibTeX and the natbib package to create the formatted bibliography and the citation callouts, all you need to do is change the author field from

 author="Ashish Vaswani et al",

to

 author="Ashish Vaswani and others",

Here, others is treated as a keyword.


A full MWE (minimum working example) and its output:

enter image description here

\documentclass{article}

\begin{filecontents}[overwrite]{mybib.bib}
@misc{aiayn,
     author="Ashish Vaswani and others",
     year=2017,
     title="Attention is all you need",
     url="https://arxiv.org/abs/1706.03762" }
\end{filecontents}

\usepackage[authoryear,round]{natbib}
\bibliographystyle{plainnat} % or some other suitable bib style
\usepackage{xurl}

\begin{document}
\citet{aiayn}
\bibliography{mybib}
\end{document}
3
  • That looks like a good solution as well.
    – arame3333
    Sep 13, 2021 at 14:57
  • @arame3333 - You actually posted a very good question, one that hasn't been asked before on this site. Had you waited a while instead of accepting the very first answer, within minutes of it getting posted, your query might well have attracted several additional answers. But by quickly accepting the first answer, you basically discouraged most would-be answer writers from providing additional answers. For sure, this site's guidelines say that while upvoting good answers immediately is fine, OPs should wait several hours, and maybe even a day or two, before accepting one of the answers.
    – Mico
    Sep 13, 2021 at 17:02
  • 2
    Good point. I was in a hurry and needed a quick answer. I shall read the guidelines for next time. I have to admit as a complete beginner in using Overleaf I was more worried it was a stupid question, but I couldn't find the answer on my Google searches!
    – arame3333
    Sep 13, 2021 at 19:11

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.