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.

I have a glossary entry which defines a symbol

\newglossaryentry{nc:line:num}{
    name=cache lines,
    symbol=\ensuremath{\#l},
    description=number of lines in cache}

and want to use its symbol in another entry inside a second glossary. Therefore I try:

\newglossaryentry{cache:swayassociative}{
    name={\glsentrysymbol{nc:line:num}-way associative},
    description={\nopostdesc},
    parent={cache},
    see={nc:line:num}

however this puts the code into the output, rather than the actual symbol.

alignment and text are off

As a bonus I am unsure how to properly right align the numbers and place the "see XXX" text properly, so that they don't overlap. (I am using the mcolalttreegroup style).

P.S.: I am trying to use glossaries for an index here, maybe it is not quite the right tool for the job, but since I actually use it for real glossaries as well, I thought it would not hurt to use a tool I am fairly familiar with (considering I am a novice and have no experience with makeidx).

P.P.S.: I used the time to take a deeper look at makeidx, and noticed that entries like \ensuremath{n}-way associative are troublesome, and the short documentation of tha package hints that i should stick with glossaries wich has extra sort keys for such cases

share|improve this question
    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Marco Daniel May 27 '13 at 18:25

1 Answer 1

up vote 2 down vote accepted

The package option sanitize=none should fix this. You can then modify the glossary style to change the position of the numbers, and other things (3.6 of the 'Documented Code' and 16.2 of the user manual):

\documentclass{report}

\usepackage[sanitize=none]{glossaries}

\newglossaryentry{nc:line:num}{
    name=cache lines,
    symbol=\ensuremath{\#l},
    description=number of lines in cache}
\newglossaryentry{cache:swayassociative}{
    name={\glsentrysymbol{nc:line:num}-way associative},
    description={\nopostdesc},
    parent={cache},
    see={nc:line:num}}
\makeglossaries%

\newglossarystyle{indexGlossaryStyle}{
    \glossarystyle{mcolalttreegroup}
    \renewcommand{\glsgroupskip}{}
    \renewcommand{\glspostdescription}{\hspace*{\fill}see}}

\begin{document}
    \printglossary[style=indexGlossaryStyle]%
    \clearpage%
    nc:line:num glossary entry '\gls{nc:line:num}`
    \clearpage%
    cache:swayassociative glossary entry '\gls{cache:swayassociative}`
\end{document}

Although, maybe some investment in a indexing package rather than a glossary would be more suitable.

share|improve this answer
    
thank you, it works like a charm, i still have to figure out the downside (otherwise it would be tha packages default setting, right?). What indexing package would you recommend, I have trouble typesetting something in math mode with makeidx and I thought glossaries looks like a little more work, but feels a lot more powerfull... –  ted May 29 '13 at 9:38
    
@ted: I have not used indexing much, but I have tried multind mainly because I wanted a few different indices. The downside for my use of glossaries is that I use entries so much that I would want to be selective about which entries are listed in an 'index'. If you are using entries rarely then maybe it would be suitable for you. –  Chris May 29 '13 at 9:48
    
I cheat a little, I type them out usually and just use the glossaries commands where I want a reference, that way I dont clutter my glossary –  ted May 29 '13 at 9:57

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.