TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way of creating glossaries, with the help of glossaries package, per chapter or section.

In a particular glossary for section should be only the terms used in this section. If term is used in multiple section - appear in correspondent glossaries.

Example (done with the help of description environment, just for an example):

enter image description here

How can I achieve this?

share|improve this question
Shall the glossary of a section (say) only contain items that are defined first in this section, or all items used in this section? (If the former, the glossaries are disjoint...) – mafp Jan 3 '13 at 22:03
I'm seeking for a way to include only the items which is used in the particular section. – m0nhawk Jan 3 '13 at 22:05
But a glossary item can be used in several sections, so shall it appear in all corresponding glossaries, or only in the first of them? – mafp Jan 3 '13 at 22:08
@mafp: if it used - yes, it all corresponding. – m0nhawk Jan 4 '13 at 8:04
up vote 11 down vote accepted

Since you don't seem interested in the location list, you could change the location counter to section and define a glossary style that checks if the current section is in the location list. You'll probably want to neaten the glossary, but here's an example:







  description={speed of light}}


      \item ##2 ##3%

% \ifinlocation{number}{location list}{body}





\section{Sample Section}


\gls{E} = \gls{m}\cdot \gls{c}^2

\section{Another Section}


\gls{E} = \frac{\gls{m}\gls{v}^2}{2}


Note that this uses xindy rather than makeindex to suppress the range formation, which makes it easier to test if the current section is in the list.

The result looks like:

image of document

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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