I am using glossaries-extra and bib2gls. I'd like to format the text of glossary entries of certain categories using mintinline. texttt works fine however, I would prefer to have some syntax highlighting.

For this purpose I've tried using:

\newmintinline{c}{}    % defines \cinline

According to the glossaries-extra documentation (page 125, textformat), this should work, since the new cinline command only accepts one argument however, the output in my document when using \gls{some-entry} is \@glo@text.

Minimal example:

\usepackage{minted}                     % Source code
\usepackage[acronym, abbreviations, record]{glossaries-extra}

\newmintinline{c}{}                     % creates \cinline

Test \gls{simple}.\\
Cinline: \cinline{void main(){ /**/ }}.\\
texttt: \gls{normal}.


  name = {verysimple},
  description = {No description},
  category = {c-code}

  name = {texttt works},
  description = {No description},


Compilation command:

lualatex -shell-escape test-minted.tex
bib2gls test-minted
lualatex -shell-escape test-minted.tex

The .glg file does not mention any errors. The _minted directory contains the following for the simple entry:


This looks like some glossaries-extra internal error produces that output, which is then successfully passed to minted / pygmentize. Does anyone have any insights into what could be going wrong here and how I could fix it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.