Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

UPDATE: I have been using glassaries for some time now, and kind of got used to it. It's not as bad as I at first thought.

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?

share|improve this question
4  
+1 for >It's like xml. :D –  Count Zero Jun 13 '12 at 21:22
4  
I hope you both mean "lovely" for "like xml" –  David Carlisle Jun 13 '12 at 22:58
3  
\glssee does ‘something’ if you use it after \makeglossaries. –  mhp Jun 14 '12 at 8:42
4  
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
3  
Would you prefer to have a command that had at least 18 optional arguments? That's the alternative to key=value syntax. The glossaries package comes with 21 sample files and a beginners' guide for people who find the main user manual too large. If something doesn't work, provide a MWE rather than just saying it's a pita. –  Nicola Talbot May 5 '13 at 11:45

3 Answers 3

Here is an alternative to a pita.

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

\let\sort\lst@BubbleSort 
\def\addtolist#1#2{
  \lst@lAddTo\alist{#2}
}

\long\gdef\addterm#1#2{\addtolist\alist{#1,}}

\def\gentry#1#2{%
\long\expandafter\gdef\csname#1\endcsname{\textbf{#1}: #2}
\addterm{#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}

Add ingredients to suit.

It provides one non-xml command:

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

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

share|improve this answer
2  
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
2  
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\addtolist#1#2{ 
  \lst@lAddTo\alist{#2} 
} 

\long\gdef\addterm#1#2{\addtolist\alist{#1,}} 

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

\def\gentryP#1#2#3{% 
\expandafter\gdef\csname#3\endcsname{\hyperlink{target#1}{#3}}
\long\expandafter\gdef\csname.#1\endcsname{\hypertarget{target#1}{\textbf{#1}: #2}}
\expandafter\gdef\csname#1\endcsname{\hyperlink{target#1}{#1}}
\addterm{#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}
share|improve this answer
    
This doesn't work: writelatex.com/322948pgpznd –  maj nem ɪz dæn Aug 26 '13 at 22:52

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 and a sample document.

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.

Edit: I have now tried this on one project. It works works nicely but can be a slight bit confusing at first, but I haven't tried any of the other solutions to this so I can't really compare them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.