[Tex/LaTex] List of symbols after equation

glossariesnomenclature

Is there way to

  • Define the symbols after the use of an equation, AND show that list right after the equation
  • Repeat that list at the beginning of the document containing all the used symbols with their defenition

I have tried the nomenclature package and even some more custom functions found on stackexchange.

The custom function wont allow me to use math symbols as variable names (for example \rho) and the nomenclature package wont allow me to list the symbols under the eq and list them at the beginning.

Help is much appricated!

Best Answer

Here is one version using a symbol field separate from the name field:

In body of document:

Sample text

List of symbols (you may well want to choose a different glossary style for this and/or set the names more carefully):

Sample list

\documentclass{report}
\usepackage{enumitem}

\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}
\makeglossaries

\newcommand{\mathgloss}[3]{%
    \newglossaryentry{#1}{name={#1},symbol={#2},description={#3}}%
    \begin{description}[labelwidth=3em]%
      \item[\glssymbol{#1}]#3%
    \end{description}%
}
\setglossarystyle{treenoname}

\begin{document}

Consider the equation
\begin{equation}
\nabla\cdot E = \frac \rho{\varepsilon_0}
\end{equation}
in which
\mathgloss{E}{\ensuremath{E}}{electric field}
\mathgloss{rho}{\ensuremath{\rho}}{charge densiyt}
\mathgloss{epsilon0}{\ensuremath{\varepsilon_0}}{permittivity of free space}

\printglossaries

\end{document}