Q:

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.

A:

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.

