MakeIndex, Nomenclature, Glossaries and Acronymsglossaries | Column Width

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
Clavigo
Posts: 2
Joined: Mon Jul 16, 2012 11:23 pm

glossaries | Column Width

Post by Clavigo »

Hi folks,

I am using the "glossaries" package in order to generate a symbols list for my thesis. This symbols list is supposed to be divided into sub-categories (parents) and it should also display units of each referenced symbol.
I was able to comply both requirements by defining a new "longtable"-style. However, I am not yet pleased with the current style of my symbols list because the width of the headline of my first sub-category defines the entire width of the first column of my table. For this reason the unit is not indented which means it is always located to the "right" in respect to the headline of the sub-category (parent). I would like to indent the entire column that belongs to the units in order to generate more space for the description-column.

The following minimal working example illustrates this issue:

Code: Select all

\documentclass[12pt,oneside,a4paper,fleqn]{book}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[nonumberlist,acronym,toc]{glossaries}


\newglossary[slg]{symbolslist}{syi}{syg}{Symbols List} % user-defined symbols list
\renewcommand*{\glspostdescription}{}

%
% -- Glossary-Style -- %%
%

% -- Symbols List -- %%

\newglossarystyle{symbol}{
\renewenvironment{theglossary}
{\begin{longtable}[l]{lp{2.5cm}p{\glsdescwidth}}}
{\end{longtable}}

\renewcommand*{\glossaryheader}{}

\renewcommand*{\glossaryentryfield}[4]{
\vspace{0.2cm}%
\glstarget{##1}{##2} & & \\%
}

\renewcommand*{\glossarysubentryfield}[5]{
\hspace{1.0cm} \glstarget{##2}{##3} & ##5 & ##4\glspostdescription\space \\%
}

\renewcommand*{\glsgroupskip}{} 
}


%
% -- Glossary-Groups -- %%%
%

% Sub-Category Greek Letters
\newglossaryentry{greekletter}{
name={\large{\textbf{Greek Letters}}},
description={\nopostdesc},
sort=parenta,
}

% Sub-Category Roman Letters
\newglossaryentry{romanletter}{
name={\large{\textbf{Roman Letters}}},
description={\nopostdesc},
sort=parentb,
}

\makeglossaries

% -- Glossary-Entries -- %%%


\newglossaryentry{symb:k}{
name=\ensuremath{k},
symbol=\ensuremath{\rm m^2/s^2},
description=turbulent kinetic energy,
type=symbolslist,
parent=romanletter,
sort=k
}

\newglossaryentry{symb:beta}{
name=\ensuremath{\beta},
symbol=\ensuremath{\rm -},
description=Constant,
type=symbolslist,
parent=greekletter,
sort=betamodell
}


\begin{document}

\printglossary[type=symbolslist,style=symbol]

\chapter{Lorem}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer laoreet porta ligula. Donec scelerisque ornare ipsum sed ultricies. Aliquam laoreet consectetur metus, sit amet dictum nunc dignissim et.

\gls{symb:k}
\gls{symb:beta} 

\end{document}
Unfortunately I have to admit that I am no expert when it comes to LaTeX so I would highly appreciate any useful tips.

Thank you very much for your help!

Greetings,
Clavigo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

glossaries | Column Width

Post by nlct »

Maybe make the first level span all three columns. For example:

Code: Select all

\renewcommand*{\glossaryentryfield}[4]{%
  \vspace{0.2cm}\\%
  \multicolumn{3}{l}{\glstarget{##1}{##2}}\\%
}
Regards
Nicola Talbot
Clavigo
Posts: 2
Joined: Mon Jul 16, 2012 11:23 pm

Re: glossaries | Column Width

Post by Clavigo »

Great! Thank you very much!!! :D

Your advice helped me a lot. I was able to tweak the style a little bit and now the glossary looks exactly the way I want it! ;)
dieter
Posts: 1
Joined: Thu Sep 06, 2012 5:04 pm

glossaries | Column Width

Post by dieter »

Hi Clavigo,

I could make use of your working example to produce a similar list of symbols. Thanks for that. However, I noticed it produces very little space between both groups (roman and greek letters).
I would like to increase a blank row after each group using
\renewcommand*{\glsgroupskip}{&&&\\}
but this does not work.
Do you have an idea how to do this?

Thanks,

Dieter
Post Reply