8

I'm working on a paper that includes a summary at the start of the document, and I would like to reset the glsdisplayfirst properties somehow, so that my glossary entries and acronyms are defined both in the summary and in the document itself. I can't seem to find a way to do this, so help is appreciated.

Example:

\documentclass[oneside]{article}
\usepackage[nonumberlist,acronym]{glossaries}

\DeclareRobustCommand{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsdisplayfirst}[4]{\glossfirstformat{#1#4}}
\makeglossaries

\newglossaryentry{term}{name={Term}, text={term}, description={A term that obviously needs explaining in the glossary}}
\newacronym{test}{TIAT}{This Is A Test}

\begin{document}

\section{Summary}
The first occurence of \gls{term} should be \textit{italic}. 
The second occurence of \gls{term} shouldn't, though. 

The full definition of \gls{test} should show just the first time, and the abbreviation afterwards, like this: \gls{test}.

\section{Rest}
The first occurence of \gls{term} should - again - be \textit{italic}. 
The rest of the occurences of \gls{term} throughout the rest of the document shouldn't, though. 

The full definition of \gls{test} should - again - show just the first time, and the abbreviation afterwards, like this: \gls{test}.

\printglossaries

\end{document}
0

1 Answer 1

15

The package glossaries provides a macro called \glsresetall. This does exactly what you want.

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex

\documentclass[oneside]{article}
\usepackage[nonumberlist,acronym]{glossaries}

\DeclareRobustCommand{\glossfirstformat}[1]{\textit{#1}}
\renewcommand*{\glsdisplayfirst}[4]{\glossfirstformat{#1#4}}
\makeglossaries

\newglossaryentry{term}{name={Term}, text={term}, description={A term that obviously needs explaining in the glossary}}
\newacronym{test}{TIAT}{This Is A Test}

\begin{document}
\section{Summary}
The first occurence of \gls{term} should be \textit{italic}. 
The second occurence of \gls{term} shouldn't, though. 

The full definition of \gls{test} should show just the first time, and the abbreviation afterwards, like this: \gls{test}.
\glsresetall
\section{Rest}
The first occurence of \gls{term} should - again - be \textit{italic}. 
The rest of the occurences of \gls{term} throughout the rest of the document shouldn't, though. 

The full definition of \gls{test} should - again - show just the first time, and the abbreviation afterwards, like this: \gls{test}.

\section{Reset one}
\glsreset{test}
You can also only reset the \gls{test} entry which should now display the full definition, the \gls{term} entry should not be affected.

\printglossaries
\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.