I'm trying to set up a newAbbreviationstyle with glossaries-extra, but have a phantom space I can't figure out.
Trying to make it so that the long name is automatically italicised for german-language abbreviations but not for english-language.
When I printglossary an extra space is added before the short name making the german-language abbreviations offset. see mwe.
MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[toc=true, section=chapter, nonumberlist]{glossaries-extra}
\makeglossaries
\newabbreviationstyle{long-short-user-em}{
%\GlsXtrUseAbbrStyleSetup{long-short-user}
\renewcommand*{\CustomAbbreviationFields}{%
name={\protect\glsabbrvfont{\the\glsshorttok}},
sort={\the\glsshorttok},
first={\protect\glsfirstlongemfont{\the\glslongtok}%
\protect\glsxtruserparen{\protect\glsfirstabbrvuserfont{\the\glsshorttok}}%
{\the\glslabeltok}},%
firstplural={\protect\glsfirstlongemfont{\the\glslongpltok}%
\protect\glsxtruserparen
{\protect\glsfirstabbrvuserfont{\the\glsshortpltok}}{\the\glslabeltok}},%
plural={\protect\glsabbrvfont{\the\glsshortpltok}},%
description={\protect\glslongfont{\the\glslongtok}}
}%
}{
\GlsXtrUseAbbrStyleFmts{long-short-user}%
\renewcommand*{\glsfirstlongfont}[1]{\glsfirstlongemfont{##1}}%
\renewcommand*{\glslongfont}[1]{\glslongemfont{##1}}%
}
\setabbreviationstyle{long-short-user}
\setabbreviationstyle[german]{long-short-user-em}
\setabbreviationstyle[english]{long-short-user}
\newabbreviation{DTA}{DTA}{Some acronym long}
\newabbreviation{DTB}{DTB}{some other acronym long}
\newabbreviation{DTF}{DTF}{blah foo blah}
\newabbreviation[category=german]{aaa}{AAA}{Some Italicised german word}
\newabbreviation[category=german]{bbb}{BBB}{Some other Italicised german word}
\newabbreviation[category=german]{ccc}{CCC}{Foo Foo Foo}
\glsaddall
\begin{document}
\printglossary[title=List of Abbreviations]
\end{document}
sharelatex link: https://www.sharelatex.com/read/zdfmqjnmkrkv
As a quick fix i'm manually setting emphasis in \newabbreviation call e.g. {ccc}{CCC}{\textit{Foo Foo Foo}} but looking for more elegant solution
%
in the line before\GlsXtrUseAbbrStyleFmts
and one in the\newabbreviationstyle
line