# Alternative to glossaries?

Is there a nicer alternative to glossaries package? It's a pita to use. Documentation is lacking examples, some commands don't do anything (like \glssee), it is hard to customize (why can't I make my glossary a simple section?), it is stateful - I have to call makeglossaries in a certain place, and also the syntax for defining new entries is ugly:

 \newglossaryentry{blah}{name=blah, description={blabh lbah blah}}


It's like xml.

No offense to the creators, but I am just curious if anyone else feels this way and if there are alternatives?

-
+1 for >It's like xml. :D – Count Zero Jun 13 '12 at 21:22
I hope you both mean "lovely" for "like xml" – David Carlisle Jun 13 '12 at 22:58
\glssee does ‘something’ if you use it after \makeglossaries. – mhp Jun 14 '12 at 8:42
You are writing a book-type document and want your glossary to appear in a simple section? Try, for example, \usepackage[section=section, numberedsection]{glossaries}. – mhp Jun 14 '12 at 8:47
Undoubtedly, the glossaries package is rather complex, but, in my experience, it enables you to realize nearly anything related to glossaries, lists of acronyms, notations etc. Since the glossaries package includes tree-like styles it might also serve as a replacement for many index-related packages. Moreover, I haven’t seen any package that supports xindy in a comparable manner. – mhp Jun 14 '12 at 8:52

Here is an alternative to a pita.

\documentclass[11pt]{book}
\usepackage{lstdoc,lipsum}
\begin{document}
\makeatletter
\def\alist{}

\let\sort\lst@BubbleSort
}

\def\gentry#1#2{%
\long\expandafter\gdef\csname#1\endcsname{\textbf{#1}: #2}
\sort\alist
}

\def\PrintGlossary{%
\@for \i:=\alist\do{%
\csname\i\endcsname\par}
}
%example
\gentry{electrolyte}{Substance containing free ions that make t
he substance electrically conductive}
\gentry{battery}{\lipsum[3]}
\gentry{poles}{\lipsum[1]}
% print the glossary
\section{Glosary}
\PrintGlossary

\battery
\makeatother
\end{document}


It provides one non-xml command:

  \gentry{<term>}{<description>}


...and it does not need Perl. Enjoy!

-
Thanks, but it's missing the equivalent of the \gls command, and I would also like to do cross-referencing. E.g. car see vehicle – drozzy Jun 13 '12 at 21:45
\gentry{car}{see vehicle}. – Yiannis Lazarides Jun 13 '12 at 21:47
So.. how would I use a glossary term in text? Or do you mean that this is only for defining a glossary section at the end, without page numbers of where it occurred? – drozzy Jun 15 '12 at 3:28

I changed the code above, so that you can do cross references:

\documentclass[11pt]{book}
\usepackage{lstdoc,lipsum}
\usepackage{hyperref}
\begin{document}
\makeatletter
\def\alist{}

\let\sort\lst@BubbleSort
}

\def\gentry#1#2{%
\long\expandafter\gdef\csname.#1\endcsname{\hypertarget{target#1}{\textbf{#1}: #2}}
\sort\alist
}

\def\gentryP#1#2#3{%
\long\expandafter\gdef\csname.#1\endcsname{\hypertarget{target#1}{\textbf{#1}: #2}}
\sort\alist
}

\def\PrintGlossary{%
\section{Glosary}
\

\@for \i:=\alist\do{%
\csname.\i\endcsname\par}

\newpage
}

%example
\gentry{electrolyte}{Substance containing free ions that make t
he substance electrically conductive}
% use gentryP if the plural is irregular
\gentryP{battery}{\lipsum[3]}{batteries}
\gentry{poles}{\lipsum[1]}

% print the glossary
\PrintGlossary

\section{normal text}

\electrolyte s are used nearly everywhere.

\newpage

\battery is the singular. but sometimes you need the plural \batteries.

\makeatother
\end{document}

-

The datagidx package in the datatool bundle might a good solution for you.

Datagidx is an improved version of the code discussed in this article.

Here is some package documentation.

I have not tried this myself yet, but it is the one I have settled on trying as my first approach because I don't like that the glossaries package has external dependencies.

-