TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is the error I am getting since I have added some new references to my .bib file. I think is more than a filled stack. Any ideas? references.bib

It was requested a minimum working example but I am working on a template and it was quite difficult for me cut it out. This is my complete structure. The master document is thesis.tex and the problem is raised only under related_work chapter. If you have the time to look at it, I would highly appreciate it. Here is the complete document.

share|improve this question
The BIB file looks fine to me. Please add a minimal working example (MWE) that generates this problem with this BIB file. – Martin Scharrer Jul 27 '11 at 17:04
There is no related_work chapter in your very non-minimal example (which compiles without error). – Lev Bishop Jul 28 '11 at 0:03
@ShinTakezou @Martin it looks like when i am changing \bibliographystyle{Latex/Classes/PhDbiblio-url2} to another class like \bibliographystyle{Latex/Classes/PhDbiblio-case} the problem is getting resolved. – Chris-Top Jul 28 '11 at 13:12
even with url2, I can't reproduce the error. It goes fine for me. – ShinTakezou Jul 28 '11 at 18:43
It compiles fine for me, too. My stack size is set to 5000. What TeX distribution do you use? – Jan Hlavacek Jul 30 '11 at 4:24
up vote 50 down vote accepted

It seems that the PhDbiblio-url2 bibliography style does not want the url field to contain \url{...}. It takes care of the url formating itself, enclosing the contents of the url field in \href{...}.

If you have something like

url = {\url{http://example.com/}};

in you .bib file, the PhDbiblio-url2 style translates that into


which creates an infinite loop in the hyperref package.

The proper way to include url in the bibliography, when using this style, is just

url = {http://example.com};
share|improve this answer

Not a useful general answer, but a specific case in Beamer:

A \begin{block} statement (without a name option) will cause this error. The correct format is \begin{block}{Block title}, or \begin{block}{} if you want no title.

share|improve this answer
very useful indeed..! – alekhine Jul 21 '15 at 15:43
This is the right answer – Amir Apr 17 at 18:32
@Amir: No, it is quite specifically the wrong answer for the question, since the question is not about beamer. – naught101 Apr 18 at 5:40
I had the same problem!! Thank you. – gsamaras Jun 24 at 0:04
@naught101 but if you have the beamer problem, google the error, you end up here, so it IS a VERY useful answer (: – drevicko yesterday

I found the solution: there was a conflict between hyperref and frenchle, so I got it fixed by replacing \usepackage{frenchle} by \usepackage[french]{babel}.

share|improve this answer
Please note that this very general error can occur for a wide variety of reasons. While switching from frenchle to the standard babel package (which is indeed very recommendable) removed the error in your document, it doesn't mean that it is a general solution. – Martin Scharrer Jan 24 '12 at 10:28

There's a config file where some numbers about "memory" TeX uses are written, I have it into /etc/texmf/texmf.cnf; you may need to change some value and regenerate formats.

stack_size = 5000        % simultaneous input sources


Of course the problem may arise from a bug in TeX macros you're using, that consumes all the stack; so we need more information.


If you want to edit that file, avoid editing /etc/texmf/texmf.cnf as always in configuration files. Instead edit the specific file in /etc/texmf/texmf.d/ - on Ubuntu currently /etc/texmf/texmf.d/95NonPath.cnf.

After editing the file you have to execute update-texmf to rewrite the configuration file.


Often it happens you can't have access to /etc or other system directories, so you need your own cnf file (and TeX tree). This link talks about it.

share|improve this answer
Changing the stack size won't fix it. It's always some TeX macro. – Martin Scharrer Jul 27 '11 at 20:48
The stack_size threw another error on a param_size, it didn't fix it as mentioned. – Chris-Top Jul 27 '11 at 21:31
@Martin not at all. It will fix it, if it's not a bug but a real need of some complex macro. Once I needed it to do some heavy tricks. If it wouldn't be so, setting another value for stack_size, like 100, wouldn't cause problems. – ShinTakezou Jul 28 '11 at 5:07
@Chris-Top we need investigate better your work; I've seen you put a link, unfortunately it is blocked by job websense, so I'll take a look later (very later) – ShinTakezou Jul 28 '11 at 5:10
... so later that I've forgot... anyway about the EDIT, the best way should be to set up things so that a common user has no to edit files in /etc at all, since common users usually can't edit them unless there's an admin flaw. – ShinTakezou Jun 13 '12 at 5:34

Another answer which only applies to Beamer:

Somehow beamer doesn't like the ' in formulas. That means if I write $t'$ I get the error, whereas $t^\prime$ works. I'm not sure if this only happens under certain conditions -- just mentioning it here since it's another possible source of this error.

share|improve this answer

protected by Martin Scharrer Jan 24 '12 at 10:28

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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