Since I battled with this a while as well and I couldn't find any helpful discussions on the web, I just read carefully the manual! Maybe this is a feature newer than this topic, so it wasn't around the days the question was asked. But I like to provide an easy way to achieve multiple columns with the glossaries
package so that others might find a solution faster.
One only needs the additional glossary-mcols
package which provides exactly that.
\documentclass{scrreprt}
\usepackage{glossaries}
\usepackage{glossary-mcols}
\makeglossaries
\renewcommand*{\glspostdescription}{} % Removes dots at the end of each entry.
\begin{document}
% Some entries.
\newglossaryentry{glos:begin}{name=Begin, description={This is the beginning.}}
\newglossaryentry{glos:bold}{name=Bold, description=\nopostdesc}
\newglossaryentry{glos:bear}{name=Bear, description={A bear can make you run fast.}}\newglossaryentry{glos:chicken}{name=Chicken, description={Tasty...}}
\newglossaryentry{glos:elephant}{name=Elephant, description=\nopostdesc}
\newglossaryentry{glos:tantalos}{name=Tantalos, description={Just a random name.}}
\newglossaryentry{glos:zebra}{name=Zebra, description=\nopostdesc}
% Use the entries so that they show up in the glossary.
\gls{glos:begin}
\gls{glos:bold}
\gls{glos:bear}
\gls{glos:chicken}
\gls{glos:elephant}
\gls{glos:tantalos}
\gls{glos:zebra}
% Print the glossary with one of the mcol styles.
\printglossary[style=mcolindex, title=Index]
\end{document}
I think for this sort of thing, you might be better off using sub-entries, like this:
\documentclass{report}
\usepackage{setspace}
\usepackage[nopostdot,nonumberlist,acronyms,section]{glossaries}
\newglossarystyle{supergroup}{%
\setglossarystyle{super}%
\renewcommand*{\glsgroupskip}{}%
\renewcommand{\glossentry}[2]{%
\tabularnewline
\multicolumn{2}{c}{%
\bfseries\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}%
}%
\tabularnewline
\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
\glssubentryitem{##2}%
\glstarget{##2}{\glossentryname{##2}}
&
\glossentrydesc{##2}\glspostdescription\space
##3\tabularnewline
}%
}
\newglossary[slg]{symbol}{sot}{stn}{Symbols}
\makeglossaries
\newglossaryentry{alpha}{
type=symbol,
name={Alphanumeric},
description={}}
\newglossaryentry{greek}{
type=symbol,
name={Greek letters},
description={}}
\newglossaryentry{area}{
type=symbol,
name={\ensuremath{S}},
description={reference area},
sort={S},
parent=alpha
}
\newglossaryentry{span}{
type=symbol,
name={\ensuremath{b}},
sort={b},
description={wing span},
parent=alpha
}
\newglossaryentry{dynp}{
type=symbol,
name={\ensuremath{q_\infty}},
description={dynamic pressure},
sort={q},
parent=alpha
}
\newglossaryentry{aoa}{
type=symbol,
name={\ensuremath{\alpha}},
description={angle of attack},
sort={a},
parent=greek
}
\newacronym
[sort={a}]
{bcr}{BCR}{Block Compressed Row}
\newacronym
[sort={a}]
{cad}{CAD}{Computer-Aided Design}
\begin{document}
\onehalfspacing
\section*{List of Symbols and Acronyms}
\glsaddall
\printglossary[type=symbol,style=supergroup]
\printglossary[type=acronym]
\end{document}
This produces:
Edit:
The justification of the parent entry can be changed by modifying the column alignment in the \multicolumn
command. For example, replace
\multicolumn{2}{c}
with
\multicolumn{2}{l}
The vertical spacing above and below the parent entry is a bit more problematic. This spacing is introduced by the first and last \tabularnewline
in the definition of \glossentry
:
\renewcommand{\glossentry}[2]{%
\tabularnewline
\multicolumn{2}{c}{%
\bfseries\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}%
}%
\tabularnewline
\tabularnewline
}%
Unfortunately, you can't simply remove the first \tabularnewline
or you'll get a ! Misplaced \omit
error. Something is being inserted at the start of the row that interferes with \multicolumn
. The simplest solution that I can think of is to insert an extra unused column like this:
\newglossarystyle{supergroup}{%
\renewenvironment{theglossary}%
{\tablehead{}\tabletail{}%
\begin{supertabular}{@{}l@{}lp{\glsdescwidth}}}%
{\end{supertabular}}%
\renewcommand*{\glossaryheader}{}%
\renewcommand*{\glsgroupskip}{}%
\renewcommand*{\glossentry}[2]{%
&\multicolumn{2}{@{}l}{%
\bfseries\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}%
}%
\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
&\glssubentryitem{##2}%
\glstarget{##2}{\glossentryname{##2}}
&
\glossentrydesc{##2}\glspostdescription\space
##3%
\tabularnewline
}%
}
The symbol list now looks like:
Best Answer
Use
\renewcommand*{\glspostdescription}{<vertical space>}
to add vertical space between the items listed.