Dictionary with marginal references

I follow a mathematica course with a lot of definitions. I want to make a list of those definitions. However sometimes terms refer to each other. To make the list more usable to read it would be nice if there was a command so I can refere to other elements in the "dictionary". I've seen this in the books of Donald Knuth as footnotes. But don't know a good package to make an elegant dictionary. Automatic alphabetical sorting of the entries would also be a nice feature.

-
Your question isn't fully clear to me. You also mention "marginal" in the title but not in the text. If you want this references as marginpars you should explicitly say so. However, then it might be better to split it into two different questions. –  Martin Scharrer Feb 23 '11 at 18:45
You could create a glossary using the glossaries package (there was recently a question about that, but I can't find it just now). But I'm not sure if you can \label and \ref between glossaries texts. –  Martin Scharrer Feb 23 '11 at 18:45
I mean the reference in the explanation don't directly refer to another page. But in the margin, the references are repeated with the page where the description of that item is. @Martin: I've taken a look to the glossaries package but it doesn't seem to handle references at all. –  CommuSoft Feb 23 '11 at 22:53

This is the purpose of the Index:

\usepackage{makeidx}
\makeindex

...

The term \emph{sarsaparilla}\index{sarsaparilla} denotes ...


You have to run makeindex and the Index will contain the word and the page number for reference. If you need also to repeat something in the margin, define a couple of commands:

\newcommand{\defineterm}[1]{\emph{#1}\index{#1}\label{term@#1}}
\newcommand{\useterm}[1]{#1\marginpar{#1, see p.~\pageref{term@#1}}}

...

The term \defineterm{sarsaparilla} denotes ...

...

... and now we employ \useterm{sarsaparilla} to ...


If you don't really need the index, just comment out the \makeindex command.

-