[Tex/LaTex] Capacity exceeded error

biblatexcapacity

I am using MacTex 2016 on a Mac (El Captain 10.11.2). My text editor is TexStudio 2.11.0 and all my packages have been updated (TeX live Utility 1.24).

Since I updated MacTex from version 2015 to version 2016, I constantly get the same error when compiling : in a file containing references, when I compile with XeLateX the first time, I get an error about exceeded capacity right where I have an \textcite or \autocite command (the following lines are just warnings) :

TeX capacity exceeded, sorry [parameter stack size=10000]. This book \autocite{adams}
'firstinits' option is deprecated, use 'giveninits' instead.
inputenc package ignored with utf8 based engines.
Patching footnotes failed.
Conflicting options.
Add \usepackage{fontspec} to the(frenchb.ldf) preamble of your document,

This file.tex would work just fine before I updated MacTex, I would compile with XeLateX, then bibtex, then XeLatex twice. But before trying to desinstall 2016 and come back to 2015 (if I am ever able to download it somewhere…), I would like to understand what I am doing wrong, and obviously I'm doing something VERY wrong.

\documentclass{book}
\title{Chapitre2}
\makeindex
\date{}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{times}
\usepackage{tipa}
\usepackage{chngcntr}
\usepackage[backend=bibtex, citestyle=authoryear-comp, maxcitenames=2, firstinits=true]{biblatex}
\addbibresource{/Users/MyName/Documents/Latex/biblio.bib}
\usepackage[utf8]{inputenc}
\usepackage{csquotes}
\usepackage[french]{babel}
\usepackage[T1]{fontenc}
\usepackage{array}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{colortbl}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{arydshln}
\usepackage{todonotes}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{phonrule}
\usepackage{tikz-qtree-compat}
\usetikzlibrary{decorations.markings, calc, shapes.misc, decorations.pathreplacing}
\usepackage{xr}
\usepackage{float}
\usepackage{gb4e}
\usepackage{hyperref}

\begin{document}

bla bla

This book \autocite{adams} is awesome.

Another awesome book : \textcite{arnason}.

\printbibliography
\end{document}

I know there are a lot of packages, but since some of them are incompatible, maybe that could be the problem.
And here are the two references I'm refering to from my bib file :

@Book{adams,
  title =     {Faroese: a language course for beginners},
  publisher = {Stiðin},
  year =      {2014},
  author =    {Adams, Jonathan and Petersen, Hjalmar P.},
  address =   {T\'{o}rshavn},
  type =      {Book}
}

@Book{arnason,
  title =     {The phonology of Icelandic and Faroese},
  publisher = {Oxford University Press},
  year =      {2011},
  author =    {\'{A}rnason, Kristj\'{a}n},
  address =   {Oxford; New York},
  type =      {Book}
}

If I forgot something important, please ask.

Thank you in advance!

Best Answer

The problem is in \automath of gb4e, together with the fact that biblatex uses an internal key with an underscore _ in its name.

This makes TeX enter a loop that ends with the dreaded “TeX capacity exceeded” message.

If you want to use gb4e and biblatex together, you need to issue \noautomath.

Other problems in your preamble are

  1. \usepackage[utf8]{inputenc}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{times}

These should be removed and

\usepackage{fontspec}

should be issued. If you want a Times like font, declare

\setmainfont{TeX Gyre Termes}

Here's an updated version of your preamble that fixes the issue.

\begin{filecontents*}{\jobname.bib}
@Book{adams,
  title =     {Faroese: a language course for beginners},
  publisher = {Stiðin},
  year =      {2014},
  author =    {Adams, Jonathan and Petersen, Hjalmar P.},
  address =   {T\'{o}rshavn},
  type =      {Book}
}

@Book{arnason,
  title =     {The phonology of Icelandic and Faroese},
  publisher = {Oxford University Press},
  year =      {2011},
  author =    {\'{A}rnason, Kristj\'{a}n},
  address =   {Oxford; New York},
  type =      {Book}
}
\end{filecontents*}

\documentclass{book}
\usepackage[french]{babel}

\usepackage{tipa}
\usepackage{fontspec}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{chngcntr}
\usepackage[
  backend=bibtex,
  citestyle=authoryear-comp,
  maxcitenames=2,
%  firstinits=true
]{biblatex}
\usepackage{csquotes}
\usepackage{array}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{multirow}
\usepackage{lscape}
\usepackage{colortbl}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{arydshln}
\usepackage{todonotes}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{caption}
\usepackage{phonrule}
\usepackage{tikz-qtree-compat}
\usetikzlibrary{decorations.markings, calc, shapes.misc, decorations.pathreplacing}
\usepackage{xr}
\usepackage{float}
\usepackage{gb4e}
\usepackage{hyperref}

\setmainfont{TeX Gyre Termes}
\addbibresource{\jobname.bib}
\noautomath

\begin{document}
\title{Chapitre2}
\date{}

bla bla

This book \autocite{adams} is awesome.

Another awesome book : \textcite{arnason}.

\printbibliography
\end{document}

The filecontents* environment is just to make the document self-contained. Use your own .bib database. You should consider using Biber instead of BibTeX.

enter image description here

If TeX Gyre Termes is not installed as a system font, declare it in the following way:

\setmainfont{texgyretermes}[
  Extension=.otf,
  UprightFont=*-regular,
  ItalicFont=*-italic,
  BoldFont=*-bold,
  BoldItalicFont=*-bolditalic,
]
Related Question