As in Glossary per chapter or section, I'm trying to use the glossaries
package to create acronym lists but only by chapter, not by section.
I've tried to adapt the answer, but I don't manage to do it.
Here's a minimal example :
\documentclass{report} \usepackage{datatool-base} \usepackage[counter=chapter,xindy,section=section]{glossaries} \GlsSetXdyMinRangeLength{0} \makeglossaries \newglossaryentry{E}{name={\ensuremath{E}},description={energy}} \newglossaryentry{m}{name={\ensuremath{m}},description={mass}} \newglossaryentry{c}{name={\ensuremath{c}},description={speed of light}} \newglossaryentry{v}{name={\ensuremath{v}},description=velocity} \newglossarystyle{mystyle}% {% \setglossarystyle{list}% \renewcommand*{\glossaryentrynumbers}[1]{\striprelax##1\endstriprelax}% \renewcommand*{\glsXchapterXglsnumberformat}[2]{##2}% \renewcommand*{\delimR}{,}% \renewcommand*{\glossaryentryfield}[5]{% \edef\doifinlocation{\noexpand\ifinlocation{\thechapter}{##5}}% \doifinlocation {% \item ##2 ##3% }% }% } \newcommand{\ifinlocation}[3]{% \DTLifinlist{#1}{#2}{#3}{}% } \def\striprelax\relax#1\endstriprelax{#1} \setglossarystyle{mystyle} \begin{document} \chapter{Sample Chapter} \printglossary \begin{equation} \gls{E} = \gls{m}\cdot \gls{c}^2 \end{equation} \glsresetall \chapter{Another Chapter} \printglossary \begin{equation} \gls{E} = \frac{\gls{m}\gls{v}^2}{2} \end{equation} \end{document}
The result looks like :
How can I remove the glossary entry about velocity in the first chapter and the one about speed of light in the second chapter ?
Thanks in advance