I am having problems with disappearing kernings when using unicode-math, glossaries and hyperref. This creates a lot of ugly spacings if not corrected somehow. I tried to correct the kerning manually, by adding \mkern2mu to the glossary entry, but this can create ugly spacing at other places
There is the optional argument of \gls{}[], that helps with this, but this is only usefull if the following sign belongs to the entry, which is not the case if there is a delimiter following, as in the MWE. This MWE works if unicode-math is not used, hyperref is not used or if xelatex is used instead of lualatex. Is there any way to make it work in lualatex with unicode-math and hyperref?
MWE:
% !TeX program = lualatex
\documentclass{scrartcl}
\usepackage{unicode-math} % Comment out to make it work correctly
\usepackage{fontspec}
\usepackage[colorlinks]{hyperref}
\usepackage[symbols]{glossaries-extra} % indices
\makeglossaries % Glossar erstellen
\newglossaryentry{sym:I}{type = symbols, name = {\ensuremath{I}}, description = {intensity}}
\usepackage{lua-visual-debug}
\begin{document}
\printsymbols
\begin{align}
&I(\lambda)|\
&\gls{sym:I}[(]\lambda)|\
&\gls{sym:I}(\lambda)|
\end{align}
\end{document}
I found a similar question, that may be related, but did not lead me to a solution: Correct kerning of hyperlinks in math mode
