I am trying to add a glossary to a document written with the amsbook
class using gls2bib
and glossaries-extra
. Unfortunately, there seems to be a weird interaction between glossaries-extra
and the table of contents in amsbook
. I suspect that it has something to do with glossaries-extra
attempting to rewrite the custom \markleft
command defined by amsbook
(see §5.1 of the glossaries-extra.sty v1.45 manual and §2.26 of the amsclass v2.20.6 manual).
Indeed, the following MWE compiles using amsart
but not using amsbook
:
\RequirePackage{filecontents}
\begin{filecontents}{glossary.bib}
@entry{a,
name={my entry},
symbol={\ensuremath{a}},
}
\end{filecontents}
% \documentclass{amsart} % works
\documentclass{amsbook} % does not work
\usepackage[record]{glossaries-extra}
\GlsXtrLoadResources[src={glossary}]
\begin{document}
% Compiles with amsbook if the following
% line is commented out:
\tableofcontents
\section{introduction}
\gls{a} is a glossary entry.
\printunsrtglossary
\end{document}
Here is the error produced by pdflatex glossary && bib2gls glossary && pdflatex glossary
with the amsbook
line uncommented:
(./glossary.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd)
\@glsxtrnotinmark
(./glossary.toc) [1{/home/rak/.texlive2020/texmf-var/fonts/map/pdftex/updmap/pd
ftex.map}]
! Argument of \glsxtrifinmark has an extra }.
<inserted text>
\par
l.22 \end
{document}
?
Adding \glsxtrRevertMarks
right before \begin{document}
gets the MWE to compile with amsbook, but the glossary then has two entries in the table of contents.
amsart
. Adding importingglossaries-extra
withtoc = false
removed exactly one of them (I don't know what's going on tho...:/).