[Tex/LaTex] Glossaries – expand acronyms for first-time use within each chapter

acronymsglossariesglossaries-extra

I am not sure if this is acceptable typographic convention – but my PhD advisor would like me to expand each acronym for its first use within each chapter of my PhD thesis.

The rationale is that, if the reader (maybe an expert) chooses to skip over the introduction (where a particular acronym was first used) and goes straight to a middle chapter, then it is quite helpful to expand the first use of acronyms in each chapter to be expanded.

How do I achieve this behavior in LaTeX using the glossaries-extra package?

Here is a minimal example demonstrating the scenario. The desired behavior is also explained and highlighted in the resulting output.

\documentclass{report}
\usepackage{glossaries-extra}
\setabbreviationstyle[acronym]{long-short}
\newacronym{tla}{TLA}{three letter acronym}
\newacronym{adc}{adc}{Analog to Digital Converter}

\begin{document}

\chapter{Introduction}
Hello world. We have too many \gls{tla}. The acronym in the previous sentence shall expand.

Note that the second  usage here \gls{tla} will not expand,  and is the expected
(and correct) behavior.

\chapter{Important Stuff}
The \gls{tla} acronym has been expanded  before. But since the reader might read
this chapter first, it is nice to  have its first usage in the previous sentence
expand.

Note that the second  usage here \gls{tla} will not expand,  and is the expected
(and correct) behavior.

\end{document}

The output is

tla_issue

Best Answer

The simplest method is to insert \glsresetall at the start of each chapter. Since etoolbox is automatically loaded (by the base glossaries package), you can use etoolbox's \preto command:

\documentclass{report}
\usepackage{glossaries-extra}

\preto\chapter{\glsresetall}

\setabbreviationstyle[acronym]{long-short}
\newacronym{tla}{TLA}{three letter acronym}
\newacronym{adc}{adc}{Analog to Digital Converter}

\begin{document}

\chapter{Introduction}
Hello world. We have too many \gls{tla}. The acronym in the previous sentence shall expand.

Note that the second  usage here \gls{tla} will not expand,  and is the expected
(and correct) behavior.

\chapter{Important Stuff}
The \gls{tla} acronym has been expanded  before. But since the reader might read
this chapter first, it is nice to  have its first usage in the previous sentence
expand.

Note that the second  usage here \gls{tla} will not expand,  and is the expected
(and correct) behavior.

\end{document}

Chapter 1 Introduction Hello world. We have too many three letter acronym (TLA). The acronym in the previous sentence shall expand. Note that the second usage here TLA will not expand, and is the expected (and correct) behavior.

Chapter 2 Important Stuff The three letter acronym (TLA) acronym has been expanded before. But since the reader might read this chapter first, it is nice to have its first usage in the previous sentence expand. Note that the second usage here TLA will not expand, and is the expected (and correct) behavior.

If you use a different class (such as memoir or scrbook) there may be a convenient hook provided that can be used instead. If you want to limit the reset to just a particular glossary type, you can use the optional argument of \glsresetall.

Related Question