# Conditionally generate word explanations in appendix

Is there a way to declare a set of conceptual keywords with their explanation that will be taken and compiled into the appendix when one of the keywords is used throughout the documents body?

For example, when having a text containing a keyword, the appendix should contain a section with the explanation of keyword:

I use the \AddExplanationToAppendixFor{keyword} in the text.


Appendix:

keyword: A very special word I would like to elaborate on: bla blah


It would be awesome if the resulting PDF would contain a hyperref to the respective appendix's section:

I use the keyword¹ in the text.


How could this be realized?

-
Did you already have a look at packages like glossaries? This should do exactly what you, if I get you right. – Benedikt Bauer Oct 30 '12 at 11:12
Have a look at tex.stackexchange.com/questions/34641/… – lockstep Oct 30 '12 at 11:18
glossaries. Of course! Thank you @BenediktBauer. I wonder what I did wrong querying google to not find glossaries would fits my needs. Yet a susequent question on glossaries: Is it possible to add paragraphs to the description? I'd like to have a certain pattern for my explanations, like name, meaning and additional information. – KoenigGunther Oct 30 '12 at 11:25
From the glossaries user manual: "If you want a paragraph break in the description use \glspar. However note that not all glossary styles support multiline descriptions" – Benedikt Bauer Oct 30 '12 at 11:42
Thank you, @BenediktBauer! – KoenigGunther Oct 30 '12 at 11:44

To put together the answer to your question and the multi-line thing from the comments, consider this MWE:

\documentclass{article}
\usepackage{hyperref}
\usepackage{glossaries}
\makeglossaries

% Define some glossary entry
\newglossaryentry{test}{name=Test, description={A multiline description.\glspar This one has two lines}}

\begin{document}
\gls{test}
\printglossaries
\end{document}


You have to call latex, makeglossaries, latex to get it all done.

According to the glossaries user manual the makeglossaries thing works only with an installed perl on your system. If don't have perl, you must call makeindex or xindy "by hand" -- in this case you must give some additional parameters that the makeglossaries tool collects by itself.

-