# Reset of the acronym with glossaries-extra

I would like to set up a glossary using the package glossaries-extra in such a way that the acronyms would be displayed in full at the beginning of each chapters for their first appearance and then only the acronym would appear.

\documentclass{book}
\usepackage{hyperref}
\usepackage[xindy]{glossaries-extra}

\makeglossary

\newacronym{lmi}{LMI}{Linear Matrix Inequality}

\begin{document}
\printglossary

Hello world

\chapter{First}
First use: \gls{lmi}
Second use: \gls{lmi}

\chapter{Second}
First use: \gls{lmi}
Second use: \gls{lmi}

\end{document}


Basically, in the code above, I am looking for a macro that displays: Linear Matrix Inequality (LMI) for the first appearance in a chapter and then simply LMI for the next appearances.

Thanks.

Romain.

I think the simplest method is to add \glsresetall to the start of each chapter with etoolbox's \preto command. (etoolbox is automatically loaded by glossaries and therefore by glossaries-extra but I've loaded it explicitly below for clarity.)

\documentclass{book}
\usepackage{etoolbox}
\usepackage{hyperref}
\usepackage[xindy]{glossaries-extra}

\preto\chapter{\glsresetall}

\makeglossaries

\setabbreviationstyle[acronym]{long-short}
\newacronym{lmi}{LMI}{Linear Matrix Inequality}

\begin{document}
\printglossary

Hello world

\chapter{First}
First use: \gls{lmi}
Second use: \gls{lmi}

\chapter{Second}
First use: \gls{lmi}
Second use: \gls{lmi}

\end{document}


First chapter:

Second chapter: