# ucthesis + polyglossia hebrew + hyperref = TeX capacity exceeded

I've run into an issue with the ucthesis class where using Hebrew language in polyglossia and using hyperref results in a "TeX capacity exceeded" error when using \maketitle (and only then!) I've put in some effort to find what seems to be the minimal code that still produces the error:

\documentclass{ucthesis}
\usepackage{polyglossia}
\usepackage{hyperref}
\setotherlanguage{hebrew}
\begin{document}
\maketitle
\end{document}


Note that this code has been pared down so much it should actually throw a different error, since I haven't defined all of the things ucthesis needs for \maketitle, but I wanted to create the minimal example. It is absolutely required to include the \maketitle line to produce the error; nothing else will create it.

Even more confusingly, if I make a custom local ucthesis.cls and replace the \maketitle definition with:

\def\maketitle{a}


I can still produce the error.

I have produced this error on both MiKTeX 2.9 on Windows XP and on MacTeX-2012 on Mac OS 10.7 (I'll give MacTeX-2013 a shot soon).

Help?

• \usepackage{etex} – Andrew Kepert Dec 10 '13 at 8:10
• I can produce the same error with: \documentclass{ucthesis} \usepackage{etex} \usepackage{polyglossia} \usepackage{hyperref} \setotherlanguage{hebrew} \begin{document} \maketitle \end{document} – Brian P Dec 10 '13 at 8:13

For some reasons, \maketitle gets redefined twice, and the second time \HyOrg@maketitle (what hyperref uses to store the old meaning of \maketitle) points to itself, thus creating a loop.

This seems to happen when the Hebrew language is loaded. The following trick should help. However, it seems a problem with ucthesis, because the issue doesn't appear with the standard classes.

\documentclass{ucthesis}
\usepackage{polyglossia}
\setmainlanguage{english}

\let\keptmaketitle\maketitle

\usepackage{hyperref}
\setotherlanguage{hebrew}

\let\maketitle\keptmaketitle

\begin{document}
\maketitle

\end{document}