I'm using glossaries to create a number of symbol lists (one for each chapter) each containing both Greek and Latin symbols. Searching through the fora it seemed to me that using sub-entries was the way to go. Everything is working but the final output could use some styling.
Currently I am using the "alttree" style, which is pretty close to what I want. Only if the symbol part would be placed after the description instead of between the name and the description (this would result in 3 columns: name, description and symbol)
Can this be done?
General ⇒ glossaries | Modifying an existing Style
glossaries | Modifying an existing Style
Last edited by sverd on Thu Dec 29, 2011 10:46 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

glossaries | Modifying an existing Style
Are you using the gloss package?
Some examples:
Maybe this ought to solve your problems?
Good Luck,
Skanda.
Some examples:
Code: Select all
@GLOSSDEF{gnu,
word="{\~n}u",
definition="Simp\'atico animal, mascota de los programadores",
sort-word="Nzzu"
}
@GLOSSDEF{pi,
word="$\pi$",
definition={Constante matem\'atica aproximadamente igual a la
versi\'on m\'as reciente de \TeX},
sort-word=pisort,
group="S"
}
@GLOSSDEF{alfa,
word="$\alpha$",
definition={Primera letra del alfabeto griego},
sort-word=alphasort,
group="S"
}
Good Luck,
Skanda.
Re: glossaries | Modifying an existing Style
Thanks for the response!
I am not using the gloss package but the glossaries package. In the documentation of the glossaries package it is mentioned that should be easy to take an existing glossaries style and modify only parts of it.....although not for me it seems..
I think I should use the sub-entry features of the glossaries package as this makes most sense, but many of the glossaries styles do not take these feature into account. The "alttree" style does and it comes close to what I would like. Hence I was wondering if someone knows how the alttree style can be modified to have the symbol part placed after the description (and get a 3-column tabular-like layout).
If I read the documentation I get the impression that is just one or two lines, but I cannot get it to work ...
I am not using the gloss package but the glossaries package. In the documentation of the glossaries package it is mentioned that should be easy to take an existing glossaries style and modify only parts of it.....although not for me it seems..
I think I should use the sub-entry features of the glossaries package as this makes most sense, but many of the glossaries styles do not take these feature into account. The "alttree" style does and it comes close to what I would like. Hence I was wondering if someone knows how the alttree style can be modified to have the symbol part placed after the description (and get a 3-column tabular-like layout).
If I read the documentation I get the impression that is just one or two lines, but I cannot get it to work ...
glossaries | Modifying an existing Style
I managed to solve my problem by changing the subentries of the alttree style. Assuming the a symbol is provided and a unit is given in the user1 entry the following seems to deliver what I wanted (although I am not yet sure about multi-line descriptions).........
Maybe this is useful for someone else as well.. 
Code: Select all
% use a modified version of the alttree code => only modify the sub-entry things
% this shows the sub-entries as: symbol description user1
% so use the following entries in the input:
% user1 entry for the units
% symbol entry for the symbol
% description entry for the description
% the name entry is not used at this moment but can be given anyway to act as kind of backup in case no sorting is available
\newglossarystyle{alttreesymbol}{%
\glossarystyle{alttree}% base this style on the list style
\renewcommand{\glossarysubentryfield}[6]{%
\ifnum##1=1\relax
\glssubentryitem{##2}%
\fi
\ifnum\@gls@prevlevel=##1\relax
\else
\@ifundefined{@glswidestname\romannumeral##1}{%
\settowidth{\gls@tmplen}{\textbf{\@glswidestname\space}}}{%
\settowidth{\gls@tmplen}{\textbf{%
\csname @glswidestname\romannumeral##1\endcsname\space}}}%
\ifnum\@gls@prevlevel<##1\relax
\setlength\glstreeindent\gls@tmplen
\addtolength\glstreeindent\parindent
\parindent\glstreeindent
\else
\@ifundefined{@glswidestname\romannumeral\@gls@prevlevel}{%
\settowidth{\glstreeindent}{\textbf{%
\@glswidestname\space}}}{%
\settowidth{\glstreeindent}{\textbf{%
\csname @glswidestname\romannumeral\@gls@prevlevel
\endcsname\space}}}%
\addtolength\parindent{-\glstreeindent}%
\setlength\glstreeindent\parindent
\fi
\fi
\hangindent\glstreeindent
\makebox[0pt][r]{\makebox[\gls@tmplen][l]{%
\textbf{\glstarget{##2}{##5}}}}%
\relax\relax
##4\glspostdescription\space \hfill{}{\glsentryuseri{##2}}\par
\def\@gls@prevlevel{##1}%
}%
}
