I want to create a glossary with 3 columns (I got this already) and I want to subdivide it into different subsections (like Roman and Greek letters). The section should be left-aligned and bold.
Here is the MWE
\documentclass[12pt,oneside,listof=totoc,bibliography=totoc,BCOR=15mm,DIV=12,headings=normal,numbers=noendperiod,parskip=half]{scrbook}
\usepackage{siunitx}
\usepackage[acronym,toc,automake,nogroupskip]{glossaries} % automake: glossary automatically compiled each time pdflatex is run
\setlength{\glsdescwidth}{\textwidth} % total width of glossary
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolslist} % create new symbolslist
\glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit} % add unit-entry to list of symbols
\glssetnoexpandfield{unit} % field for unit does never expand
\makeglossaries % calls backend to sort and typeset glossries, list of acronyms, list of symbols etc.
\newglossarystyle{symbunitlong}{%
\setglossarystyle{long3col}% base this style on the list style
\renewenvironment{theglossary}{% change the table type to three columns
\begin{longtable}{lp{0.75\glsdescwidth}>{\arraybackslash}p{1.3cm}}}%
{\end{longtable}}%
\renewcommand*{\glossentry}[2]{% change the displayed items
\glstarget{##1}{\glossentryname{##1}} % symbol
& \glossentrydesc{##1}% description
& \glsunit{##1} \tabularnewline % unit
}
}
% defining the two sections
\newglossaryentry{header1}{name={Section 1},description={},sort=000,unit={}}
\newglossaryentry{header2}{name={Sectino 2},description={},sort=001,unit={}}
% adding two entries
\newglossaryentry{firstEntry}{name=\ensuremath{a_1},
sort=a1,
description={Some description},
unit={\si{-}},
type=symbolslist,
parent=header1}
\newglossaryentry{secondEntry}{name=\ensuremath{b_2},
sort=b2,
description={Some description},
unit={\si{-}},
type=symbolslist,
parent=header2}
\begin{document}
\glsaddall
\printglossary[type=symbolslist,style=symbunitlong,title={List of Important Symbols}]
Hello World
\end{document}
Defining the two "Sections" at the beginning destroys the entries coming afterwards. Everything works fine if I do not define a parent. Can you help me? Thanks :)
\glsdescwidthis meant to be the width of thedescriptioncolumn of your glossary (that's why it's called that). It would be clearer to use it as such and set\setlength{\glsdescwidth}{.75\textwidth}instead. – schtandard Mar 01 '20 at 16:50