9

I am using natbib to manage my references, and I have a problem: I want to limit the number of authors displayed in the bibliography to 5 authors 'et al', but my reference list always displays all author names of an article.

The options I have for natbib are as follows:

\usepackage[square,sort&compress,sectionbib]{natbib}

With biblatex I could use:

\usepackage[maxnames=5]{biblatex}

but seems it is not compatible with natbib.

Is there a similar option for natlib? Thanks in advance for your help.

EDIT1 I am using Overleaf, so I don't think I can change the hardcoded values. Bibliography stile is \bibliographystyle{francaissc}

EDIT2

I saw natbib: how to display partial authors in reference but I don't like very much thesolution (at the end remove manually the authors). It would be a pain as there are hundreds of citations in my bibtex file, and as I tis not determined how much authors I will have to let at the end.

Any idea how to do it?

EDIT3 My message was marked as a possible duplicate of natbib: how to display partial authors in reference but there is NO SOLUTION provided inside this message.

  • 1
    Welcome to TeX.SX! I don't think there is a general natbib option. It will depend on the .bst/\bibligraphystyle you use. Normally the cut-off values are hard-coded there. – moewe Mar 12 '18 at 16:02
  • See also this very similar question https://tex.stackexchange.com/q/127705/35864. But there are also some styles that allow you to control the number of names displayed via an interface: https://tex.stackexchange.com/q/184948/35864. We need to know what style you use to be able to help in more detail. – moewe Mar 12 '18 at 16:03
  • 1
    Please do reveal which bibliography style you employ. (natbib is primarily a citation management package. It's not involved in the details of how bib entries are formatted (incl truncation decisions for long author lists). – Mico Mar 12 '18 at 16:05
  • I am using overleaf, so i don't think I can change the hardcoded values.

    Bibliography stile is \bibliographystyle{francaissc}

    – johnbell1212 Mar 12 '18 at 16:36
  • 1
    In the referenced question there were two answers. The accepted one does not require you to manually remove the authors, so I think it perfectly solves your problem. – Marcel Krüger Mar 13 '18 at 11:19
  • 4
  • if I use \usepackage{achemso} \setkeys{acs}{maxauthors = 5} As suggested in https://tex.stackexchange.com/questions/184948/allow-more-authors-before-replacement-by-et-al-with-natbib-achemso it don't work because this package is not on overleaf. Is there any way to put this option direcly in natbib, since I want to have the same limit for all the bibliography ? – johnbell1212 Mar 13 '18 at 13:39

1 Answers1

3

I recommend changing the style file like in the aswer of natbib: how to display partial authors in reference, but if you only want to change your TeX file, you can use the following to print et collab after five authors, if there are more:

\documentclass{article}
\usepackage[square,sort&compress,sectionbib]{natbib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Book{Batty:2007,
  author    = {Michael Batty and Max Musti and Someone Else and Another One and Still exists and Who Else},
title     = {Cities and Complexity},
publisher = {MIT Press},
year      = 2007}
@Book{atty:2007,
author    = {Michael Atty and Max Musti and Someone Else and Another One},
title     = {Cities and Complexity},
publisher = {MIT Press},
year      = 2007}
\end{filecontents*}

\let\oldthebibliography\thebibliography
\renewcommand{\thebibliography}[1]{%
  \oldthebibliography{#1}
  \let\oldbibitem\bibitem
  \let\oldtextsc\textsc
  \def\oldbbland{et}
  \newcounter{authorcount}
  \def\bibitem[##1]##2{%
    \let\textsc\oldtextsc
    \let\bbland\oldbbland
    \oldbibitem[##1]{##2}%
    \let\textsc\mytextsc%
    \let\bbland\mybbland
    \setcounter{authorcount}{0}
  }
  \def\mybbland{\setcounter{authorcount}{0}\oldbbland}
  \def\dropetal##1.{ \bbletal}
  \def\mytextsc##1{%
    \oldtextsc{##1}%
    \stepcounter{authorcount}%
    \ifnum\value{authorcount}=5\relax%
      \expandafter\dropetal%
    \fi%
  }%
}
\begin{document}

This a citation \cite{Batty:2007}\ and \cite{atty:2007}

\bibliographystyle{francaissc}
\bibliography{\jobname}

\end{document} 

enter image description here