The MWE may same as provided in this page or I have copied.
There should be two options, 1. Each unique glossaries per chapter is printed which is not used earlier chapter
2. Each chapter glossaries are printed irrespective of used earlier or not. In this case, there may be some repetition of glossaries even if it used in previous chapters.
Code: Select all
\documentclass{book}% I am trying it for book
\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}% % I want to use style=super for per chapter glossary with aligned description
\renewcommand*{\glossaryentrynumbers}[1]{\striprelax##1\endstriprelax}%
\renewcommand*{\glsXchapterXglsnumberformat}[2]{##2}%
\renewcommand*{\delimR}{,}%
\renewcommand*{\glossentry}[2]{%
\edef\doifinlocation{\noexpand\ifinlocation{\thechapter}{##2}}%
\doifinlocation
{%
\item \glossentryname{##1} \glossentrydesc{##1}%
}%
}%
}
\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}
\end{document}
[img]
https://i.stack.imgur.com/nb9hI.png
[/img]