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}
Thank you very much for your help!
Greetings,
Clavigo