# glossaries and csquotes: how to use autoquotes in gls description?

I am trying to get csquotes's \MakeAutoQuote to work with glossaries - no luck so far. The defined autoquotes are simply not active anymore by the time the description is read.

Here is the MWE:

\documentclass[german]{article}

\usepackage{babel}

\usepackage[autostyle,english=american,german=guillemets]{csquotes}
\MakeAutoQuote{“}{”}

\usepackage[xindy,nonumberlist,numberedsection=nolabel]{glossaries}

\newglossaryentry{Test}{
name={Test},
text={Test},
description={Here “it doesn't” work.}}  % <--- quotes not active!

\makeglossaries

\begin{document}
“works”

\printglossary
\end{document}


The result:

I don't quite understand it. The string is not written to any file, the quote characters are non-standard (so they are unlikely to be overwritten), and they are made active before the \newglossaryentry macro. Any ideas?

PS: to compile the MWE, save it as glossary.tex, then:

lualatex glossary.tex
makeglossaries glossary
lualatex glossary.tex


Ah, reading the csquotes source (and then I also found it in the docs, duh!) helps. Active quotes are only enabled \AtBeginDocument. So both of those solutions work if used in the preamble:
\@enablequotes

\AtBeginDocument{\newglossaryentry{Test}{...}}

• I wouldn't use \newglossaryentry in \AtBeginDocument or it will trigger the creation of the .glsdefs file (unless you use \usepackage[docdef=restricted]{glossaries-extra}). – Nicola Talbot May 5 '18 at 12:48
• Indeed, I wondered about that message since it sits there for a while :) I solved it with your hint from the manual: put the \AtBeginDocument line before the \usepackage{glossaries} and then it won't create the file either. Thank you! – MiB May 6 '18 at 10:20