2

I am having troubles with getting glossaries-extra running when using \glslink command. For example when trying to compile

% !TeX TS-program = pdflatex
% !BIB TS-program = bibtex
\documentclass[journal]{IEEEtran}
\usepackage{mathtools,xparse}

\usepackage[xindy,symbols,nomain]{glossaries-extra}
\makeglossaries

\DeclarePairedDelimiter\parens{\lparen}{\rparen}

\glsxtrnewsymbol[description={xxx}]{symb:pdf}{\ensuremath{ p\parens*{ aa | bb } }}

\NewDocumentCommand\pdf{moo}{%
    \glslink{symb:pdf}{p_{#3}\parens*{#1 \,\middle|\, #2}}%
}

\begin{document}
    asd
    \begin{align}
            \pdf{ a }[b][]
    \end{align}
    \printglossaries
\end{document}

I get the error message

! Undefined control sequence.
l.11 \glsxtrnewsymbol
                     [description={xxx}]{symb:pdf}{\ensuremath{ p\parens*{ a...

What am I doing wrong here?

Edit:

Surprisingly, it works when adding \gls{symb:pdf} e.g. before \begin{align}. And it does not work when adding it after the first use \pdf. Why is that?

3
  • 1
    There seems to be a problem with \glslink (which I'll investigate). Try using \glsdisp instead. (I don't know why you're getting that undefined control sequence error. I can't reproduce that with your MWE.) Jun 21, 2018 at 13:33
  • @NicolaTalbot I encountered similar error using MiKTeX on Windows. Simplified MWE added below.
    – Peter
    Aug 11, 2018 at 3:17
  • 1
    This bug should now be fixed in version 1.35 (2018-08-13). Aug 13, 2018 at 18:34

1 Answer 1

2

The error persists in glossaries-extra v1.34 (MiKTeX + TeXstudio on Windows 10).

Simplified MWE:

\documentclass{article}

%\usepackage[automake=true]{glossaries}
\usepackage[automake=true]{glossaries-extra}
\makeglossaries

\newglossaryentry{a}{
    name={name},
    description={desc}
}

\begin{document}

%   \glsdisp{a}{disp}
    \glslink{a}{link}

    \printglossaries

\end{document}

! Undefined control sequence.
\glsxtrdiscardperiod #1#2#3->\glsxtrifwasfirstuse
                                                  {\glsifattribute {#1}{reta...
l.15  \glslink{a}{link}

Changing glossaries-extra to glossaries or uncommenting \glsdisp{a}{disp} before \glslink{a}{link} causes the document to compile without errors.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .