Limit on number of References?

I’ve just run into what I believe may be a limit to the number of References I can use … I’m using the BibDesk app to manage References on a Mac running Catalina, using Scrivener with LaTeX.

When I have 352 References, everything compiles fine. Then if I add one more Reference to 353, I get the following error:

[b]! LaTeX Error: Counter too large.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.

I realize that I may ultimately need to construct an MWE before I can pose the question to others on SE. I also realize that 353 is a LOT of References (I have NO idea what I’ll do if 353 happens to be a hard limit), but first I thought I’d ask if anyone else has run into this issue, or if this is simply a known limit to Scrivener, LaTeX, and/or BibDesk, or possibly some other LaTeX package I have loaded.

Any feedback, thoughts or comments would be appreciated.

Thank you,
:confused: :frowning:

We lost quite a few posts on this thread (basically we found 353 is not a hard upper limit so something else must have been triggering it), but here is the latest update from @scrive:

Thank you for pointing out the post-upgrade disappearance of the postings following my original posting for Limit on number of References?.

That said, after some research, I have learned that the issue I raised in my original posting appears when I have attempted to have more than 26 references that have an identical author and year combination when using the natbib package for citations and references. Natbib uses the author–year sorting scheme as a default.

As background, I am using the apacite.bst bibliography-style file with Natbib. When using the apacite.bst bibliography-style file, Natbib attempts to handle identical author and year combinations by automatically adding a single sequential letter a … z from the alphabet to the end of each of the identical author and year combinations, but obviously runs out of letters after the letter ‘z’, hence the 26 limit. I have yet to find a legitimate way around this limitation.

FYI, following up on your suggestion to convert my project to biblatex et al. as a way to avoid the issue, I spent a few days trying to convert my project from natbib to biblatex, but gave up once I realized that my project was too far committed to the natbib package with all of it’s commensurate packages to successfully make the necessary change.

Right now I am researching what options I may have with natbib to avoid the 26 a … z letter limit on identical author-year combinations that natbib has. I’ve temporarily circumvented the issue by making a slight adjustment to one or more of the otherwise identical author-year entries, such as adding a period after the author’s name, that allows the project to compile, but is not strictly legitimate.

I’d welcome any thoughts you or others may have on how I can adapt natbib to accommodate more than 26 identical author-year items in a bibliography.

Thank you for your help in sorting this issue out.
Thanks, scrive
:slightly_smiling_face: :crazy_face: :scream:

Hi nontroppo,

I’ll post any updates/information on the LaTeX-natbib limitation to 26 identicalauthor-year’ references if/when I have learned something new. I welcome any thoughts or comments you or anyone else may have on the subject.

I don’t know if/when I might try to convert my natbib based references to biblatex as you suggested. Any thoughts or recommendations you may have to help me do so would be appreciated. StackExchange has been of some help, but the depth (or lack thereof) of my knowledge of LaTeX is affecting the transition.

I am still a neophyte on this new L&L forum, so I hope this note is properly posted, my apologies if it is not.

Thank you for all you help,

My LaTeX knowledge is shaky too, I normally always use Pandoc’s CSL for all my references, I don’t use BibLaTeX or Natbib at all (CSL is much easier to tweak and Pandoc can create huge bibliographies across PDF / DOCX / EPUB / HTML in fractions of a second, fast and footloose)!

I don’t honestly know if BibLaTeX+Biber will work better for you, I do know it is more up-to-date and actively developed (e.g. you can post issues here: Issues · plk/biber · GitHub).

To convert from Natbib to BibLaTeX will depend on whether there is a BibLaTeX bibliography format you are happy with. Then you need to change your LaTeX template to call the correct package. If you use Pandoc, then you can use the LaTeX template that can switch from Natbib to BibLaTeX using the commandline switch --biblatex – but I think you use MMD directly?

Read through §4.11.4 of the bibLateX user manual:

Let’s assume we’re using an author-year style and set uniquename=false. In
this case, we would get the following citations:

Doe 2008a
Doe 2008b
Smith 2008a
Smith 2008b

Since the family names are ambiguous and all works have been published in the same
year, an extra letter is appended to the year to disambiguate the citations. Many style
guides, however, mandate that the extra letter be used to disambiguate works by the
same authors only, not works by different authors with the same family name. In
order to disambiguate the author’s family name, you are expected to add additional
parts of the name, either as initials or in full. This requirement is addressed by the
uniquename option. Here are the same citations with uniquename=init:

J. Doe 2008
E. Doe 2008
Smith 2008a
Smith 2008b

uniquename=init restricts name disambiguation to initials. Since ‘J. Smith’
would still be ambiguous, no additional name parts are added for the ‘Smiths’. With
uniquename=full, names are printed in full where required:

J. Doe 2008
E. Doe 2008
John Smith 2008
Jane Smith 2008

Basically, there is a mechanism to improve the disambiguation which does not use the [a-z] appending alone, I asusme that should solve your problem, if you can upgrade to BibLaTeX :ghost:

Hi nontroppo,

Thank you for the extensive research … :astonished:

Now I need to do my own research about how to implement Biblatex/Biber in my project.

Thank again,
:thinking: :pensive:

P.S. I’ve also started looking into using Pandox for references, as per your suggestion … starting with an installation … interesting, FYI, I have no particular allegiance to Biblatex/Biber … I’m interested in whatever works!

Hi nontroppo,

After reading up on the BibLaTeX bibliography formats, I am not sure if BibLaTeX will do the trick.

Your analysis does a wonderful job of explaining how the settings uniquename=init and uniquename=full should satisfy almost all instances where there are identical author-year bibliographic items:

  1. First by expanding the initials to full first names, and if that is not enough to disambiguate the items,
  2. Second by adding a single sequential letter starting with a through z to the author-year combinations.

What I have in my bibliography, however, are 26 entries that have the same exact full-name and year, so if (more likely when) I need to add my 27th entry with the same exact full-name and year, I will experience the same error that stopped my project from compiling in the first place.

One solution would be a bibliography manager with an option to add two sequential digits and/or letters after the full-name and year to disambiguate the more-than 26 identical entries in the bibliography, but I haven’t seen such an option in what I have read so far. The option may certainly exist, but perhaps I may have not searched or read carefully enough to find it.

I realize that ANY bibliography having more than 26 identical full-name and year entries is extremely unusual, hence the dearth of options to handle such a situation, but I will continue to look for a bibliography manager (BibLaTeX, Pandoc, or whatever … ) that can handle my situation natively.

Any thoughts and/or comments are greatly appreciated …

Thanks again for all your help and assistance,
:slightly_smiling_face: :thinking: :pensive:

In my field, one would disambiguate this by referencing the journal as well:
Smith, Nature 2008
Smith, Adv. Mater. 2008
and so on.

Or, for something like a set of letters or emails from Smith:
Smith, June 2008
Smith, 5 August 2008
Smith, 15 August 2008

But I have no idea what Natbib or BibLaTeX would do, as I don’t use either.

1 Like

CSL solves this by using multiple letters, e.g. Doe 1995za, and there are many other disambiguation rules:

It also supports adding e.g. journal/date etc. using a final choose rule if your other disambiguation options don’t disambiguate sufficiently:

1 Like

Hi nontroppo,

Thank you for the research behind the CSL references you posted.

I’ll need to look into CSL to understand if/how I can incorporate CSL into my Scrivener/LaTeX project, if/how that is possible.

The CSL approach of adding two characters the the author+year key for disambiguation makes sense. I had read about the methodology some time ago but could not find the link again.

Now all I need to do is figure out how to make it work with my project.

Thanks again,

Yes, the main issue is you’ll need to find a workflow from Scrivener via Pandoc to LaTeX. I assume you already basically output LaTeX from Scrivener? Pandoc can read LaTeX but it “converts” it into an abstract syntax that allows it to then transform it to other formats. I suspect if you use quite a lot of customised LaTeX then this may fail. A more robust solution is to think about using markdown in Scrivener, and then transforming that, but that may throw away all of your current compilation setup. Neither step is straightforward, and trying to properly test BibLaTeX seems a more reasonable first step…

I use CSL in Scrivener by using Pandoc’s temporary citations in markdown, which are the citation key (like BibTex) but using an @, optionally surrounded by [] and seperated by ; so e.g. [@shipp2013; @li2020] — a regex could probably do the brunt of the work to convert to this but the rest of the workflow remains a problem for you.

Have you tried making a minimal LaTeX document using your template + BIB file with 27 identical refs and then you can test it, if you post it here I can try to run it through BibLaTeX and/or CSL + Pandoc and see what happens :face_with_monocle:

1 Like

Hi nontroppo,

Thank you ever so much for your research into this disambiguation issue …

I am a bit overwhelmed at all that I will need to do to implement the disambiguation that CSL + Pandoc has to offer … and for your offer to have a look at “a minimal LaTeX document using your template + BIB file with 27 identical refsto run it through BibLaTeX and/or CSL + Pandoc.

I will need to spend some time to understand what I need to do, then spend time to implement, to take you up on your offer!

Please allow me some time before I get back to you … but rest assured I appreciate what you are doing to help with this disambiguation issue.

Thank you again,
:grinning_face_with_smiling_eyes: :thinking:

Hi kewms

Thanks for your note.

What software do you use to disambiguate the references in the examples you provided ?


Sorry, I was unclear. This is the naming convention the journals in my field would use for final citations, not software-generated keys.