I'm using natbib package with compress option, which works well in the case [1-3]. However, I hope that [1,2] could also be compressed as [1-2].


1 Answer 1


The built-in mechanism in natbib does not make range for two numbers. To do that, we have to patch the code:

  title   = {Some things {I} did},
  author  = {Other, A. N.},
  journal = {J. Irrep. Res.},
  year    = {2012},
  pages   = {x-y}

  title   = {Cool!},
  author  = {Nobacon, D.},
  journal = {Ann. Improb. Res.},
  year    = {2012},
  pages   = {a-b}

All I'm doing there is taking out the test which seems to generate the comma (using \@citea): natbib is very careful not to use too many macros and registers, but that makes the code a bit tricky to read!

  • Note that a different solution would be needed for the cite package (another patch) or for biblatex.
    – Joseph Wright
    Dec 14, 2012 at 8:46
  • Is there a similar way to change the default "--" between compressed entries to "-"?
    – Mirai
    May 16, 2017 at 9:29
  • @Mirai That's what the -- in the above provided: the ligature for an en-dash. Using a hyphen here isn't typographically correct but of course it's your call ultimately ...
    – Joseph Wright
    May 16, 2017 at 9:47
  • Thank you for help, but you are only partly correct, a hyphen is correct in some styles and some languages - but one type of "range delimiter" should be used along in a single work
    – Mirai
    May 16, 2017 at 10:16

You must log in to answer this question.

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