## LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and Acronyms ⇒ Several bugs with glossaries Topic is solved

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
nabufe86
Posts: 5
Joined: Sat Jul 19, 2014 10:21 pm

### Several bugs with glossaries

Hi all,

after spending 3h trying to fix this and googling for solutions I give up...

I am using MikTex & Texmaker on a Windows 7 OS.

I use the following code:
%%----------Preamble------------- \documentclass[12pt]{article}\usepackage{amsmath}\usepackage{datatool}\usepackage[hidelinks]{hyperref}\usepackage{glossaries}       \makeglossaries\author{NA. Bufe}\title{Some equations}  \begin{document} %%--------Glossary entries----------\newglossaryentry{sediflux}{name=\ensuremath{q_s},   description={Unspecified sediment flux per unit width ($m^2$ $s^{-1}$)}}\newglossaryentry{sediheight}{name=\ensuremath{h_s},   description={Sediment thickness ($m$)}} %%------------Title & TOC----------\maketitle\tableofcontents  %% -------Glossary-------- \setglossarystyle{long3col}\setlength\LTleft{0pt}\setlength\LTright{0pt}\printglossaries[title=Symbols]  %% -------Section 1-------- \section{Transport limited versus Detachment limited}\subsection*{Transport limited}Exner Equation\begin{equation}(1- \lambda_p) \frac{\partial \gls{sediheight}}{\partial t} = - \frac{\partial \gls{sediflux}}{\partial x} \end{equation} \subsection*{Detachment limited}\begin{equation}\frac{\partial  \gls{sediheight}}{\partial t}=-K\tau_b\end{equation}\newpage\end{document}

When I generate the pdf everything works sort of fine but there are two weird issues.

1) I cannot add options to \printglossaries. Any options that I add just print out as a normal text (as shown in the example). For the style I got around it by just defining the style using \setglossarystyle but for additional options (such as nonumberlist) that won't work.

2) Once I have a newglossaryentry and then I change a little thing (e.g. change the name or add a word in the description etc.) and then rerun the code, the glossary is not updated and also the references in the text are not updated. For that to happen, I need to delete the entry entirely, rerun and then add the modified entry and rerun. I also checked the .glo file and that file just isn't updated. When I add a new entry, the entry is added fine but all the old entries are not updated when I make small changes to them (even after adding a new entry). Hmm I hope that makes sense.

Finally, as you can see in the example, the longtable of the Glossary wraps the text in one of the center column even though the page is still wide enough so that the text could be in one line. I can fix that using the "long4col" style but that doesn't seem right. Is there any way to increase the size of the middle column in the table?

thanks a lot!
Attachments
test.pdf

esdd
Posts: 34
Joined: Sat Jan 25, 2014 9:13 pm
Location: Germany
1) Use
\printglossary[title=Symbols]

2) Define the entries outside the document environment

%%--------Glossary entries----------\newglossaryentry{sediflux}{type=main,name=\ensuremath{q_s},   description={Unspecified sedimentes flux per unit width ($m^2$ $s^{-1}$)}}\newglossaryentry{sediheight}{type=main,name=\ensuremath{h_s},   description={Sediment thickness ($m$)}} \begin{document}

3) The width of the description column is governed by the length \glsdescwidth. Use something like

\setlength\glsdescwidth{.8\linewidth}

Best regards
Elke

nabufe86
Posts: 5
Joined: Sat Jul 19, 2014 10:21 pm
Magic... Next time I will ask earlier

Thanks a lot

Johannes_B
Site Moderator
Posts: 3598
Joined: Thu Nov 01, 2012 4:08 pm
\iffalseIn the example below i missused the description field to typesetthee unit. I would not recommend that and rather define a newstyle. The Option xindy uses xindy as the external processor, sortingyour entries. If an entry is not used, it will not appear in the list. Please be aware, that units are typeset upright. Package siunitxcan be of great help with that. \fi  \documentclass[12pt]{article}\usepackage{amsmath}\usepackage{siunitx}\usepackage[nomain,xindy]{glossaries}\newglossary[slg]{symbols}{sls}{slo}{\glssymbolsgroupname} \newglossaryentry{sediheigthA}{%	name={sediment thickness},	description={m},%Missusing desc here	symbol={\ensuremath{h_{s}}},	type=symbols,	user1=m,}\newglossaryentry{waterheightA}{%	name={water depth},	description={m},%Missusing desc here	symbol={\ensuremath{h_{w}}},	type=symbols,	user1=m,}\newglossaryentry{nabufe}{%	name={nabufe},	description={a \LaTeX-user},%Missusing desc here	symbol={\ensuremath{\mathit{Na_{Bu}Fe}}},	type=symbols,} \setglossarystyle{long4col}\makeglossaries\let\glsunit\glsuseri \begin{document}  %\maketitle%\tableofcontents%\clearpage%JB: I always recommend clearpage \newcommand{\waterheight}{\ensuremath{h_w}}\newcommand{\sediheight}{\ensuremath{h_s}}%JB: Using ensuremmath here \section*{Symbols}\begin{tabular}{l l}	\waterheight &Water depth ($m$)\\	\sediheight &Sediment thickness ($m$)\\\end{tabular} \section{using it}The \gls{waterheightA} is about 30 meters.$\glssymbol{waterheightA}=\SI{30}{\meter}$Please be aware that units are typeset upright. You can usepackage siunitx. The \gls{sediheigthA} \glssymbol{sediheigthA} is given in\glsunit{sediheigthA}.\begin{equation}	x+y = \sediheight \ne \waterheight\end{equation}\printglossary[type=symbols]\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

nabufe86
Posts: 5
Joined: Sat Jul 19, 2014 10:21 pm
Thanks for that. That looks a little more involved then what I have (and will require new packages installed). I will have look sometime!