19

I'm using the acronym package to produce a list of abbreviations and acronyms. Now, I want that the full name is printed after every new section and/or chapter. For example:

\acro{PC}{Personal Computer}

The usage would be:

Chapter 1:
\ac{PC} with puts out "Personal Computer (PC)" since its the first usage. For every further usage within this chapter it puts out only "PC".
Chapter 2:
Now \ac{PC} should again print "Personal Computer (PC)" for the first usage and only "PC" for all following. Currently it prints in both cases only "PC".

It would also be nice if there is an option to enable this also for each section.

  • 3
    call \acresetall at the beginning of a chapter. Or -- untested -- load the etoolbox package and place \preto\chapter\acresetall in your preamble (or \preto\section\acresetall if you want to reset at each call of \section) – clemens Aug 2 '13 at 12:31
  • Thank you! exactly what i was looking for. Unfortunately, I cant vote up your comment. Maybe if you write a complete answer. – bonanza Aug 2 '13 at 12:52
26

acronym provides \acresetall for resetting the behaviour. After using it each acronym will behave as if it is called for the first time. So just call \acresetall at the beginning of a chapter (or section).

In order to automate this you can load the etoolbox package and place \preto\chapter\acresetall in your preamble (or \preto\section\acresetall if you want to reset at each call of \section):

\documentclass{scrartcl}

\usepackage{acronym}
\newacro{fb}{foo bar}

\usepackage{etoolbox}
\preto\section\acresetall

\begin{document}

\section{foo}
\ac{fb} and \ac{fb}

\section{foo}
\ac{fb} and \ac{fb}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.