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


\glsresetall, which will affect acronyms but shouldn't affect the glossary per chapter. I recommend that you post a follow-up question with a MWE that reproduces the problem. – Nicola Talbot Aug 13 '18 at 18:45\glsresetallfor all chapter as a trial, and found that glossaries now printed for all chapter. But sometimes in compiling its don't prints and sometimes it does. Is there any particular compiling order sequence in which I should compile for creatingglossariesandindex. Here my index is not printed. – Deb bijan Aug 14 '18 at 02:29