I can offer you an \undefleipzig
so you are able to reset an abbreviation with \newleipzig
:
\documentclass{article}
\usepackage[nomain,nostyles]{glossaries}
\usepackage{glossary-inline}
\usepackage{leipzig}
\newcommand{\undefleipzig}[1]{\csundef{glo@\glsdetoklabel{#1}@name}}
\undefleipzig{erg}
\newleipzig{erg}{erg}{nokaku}
\makeglossaries
\begin{document}
test
{\Erg}
\printglossary[style=inline]
\end{document}
The problem is that \newleipzig
does \newacronym
, when glossaries
is loaded. So when one tries to redefine an existing abbreviation, the protection mechanism of glossaries
enters into action. With the \undefleipzig
trick, this mechanism is disabled for the particular entry we want to kill.
A possible definition of \renewleipzig
to supplement the existing \newleipzig
could be
\documentclass{article}
\usepackage[nomain,nostyles]{glossaries}
%\usepackage{glossary-inline}
\usepackage{leipzig}
\makeatletter
\newcommand{\renewleipzig}[2][]{%
\if@leipzig@defined{#2}
{%
\renew@leipzig{#1}{#2}%
}%
{%
\PackageError{leipzig}
{Abbreviation `#2' undefined}
{No `#2` abbreviation is defined, use \string\newleipzig}%
\@gobbletwo
}%
}
\def\if@leipzig@defined#1{%
\uppercase\expandafter{\expandafter\ifcsname\@car#1\@nil}\@cdr#1\@nil\endcsname
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
\def\renew@leipzig#1#2{%
\ifcsname glo@\glsdetoklabel{#2}@name\endcsname
\csundef{glo@\glsdetoklabel{#2}@name}
\fi
\if\relax\detokenize{#2}\relax
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\newleipzig{#2}}{\newleipzig[#1]{#2}}%
}
\makeatother
\renewleipzig{erg}{erg}{nokaku}
\newleipzig{aaa}{bbb}{ccc}
\renewleipzig[first=UUU]{aaa}{bbb}{ccc}
\makeglossaries
\begin{document}
test
\Erg{}
\Aaa
\Aaa
\printglossary
\end{document}
I'm not sufficiently expert in leipzig
to understand if the result is as expected.
leipzig.sty
,\newleipzig{erg}{nok}{nokaku}
(or whatever) should do.