[Tex/LaTex] TeX capacity exceeded, sorry [input stack size=5000] error with glossaries

errorsglossariesmemory

I'm getting the following error when I simply include \gls{rsh} in my paper, and there's clearly an okay reference to rsh in my file glossaries.tex, which looks like the entry below:

\newglossaryentry{rsh}
{
    name={\ensuremath{R'(\hat{S})}},
    description={Function of aggregate per-capita social capital},
    sort=S-hat
}

This doesn't seem to be much like anyone else's query, as I'm almost certain this has something to do with my \usepackage{glossaries}, but I can't tell what.

Check out my project files here. Thanks!

Best Answer

Remove the hanging package. Or at least disable the hanging quotes with \usepackage[notquote]{hanging}.