The main problem here is that the top level entries (denoting the Greek and Latin entries) are in the first column of the table, so that column must be at least as wide as those headings. There are a number of ways to resolve this.
The first method adjusts the style to make the top-level entries span both columns. It's more efficient to move the font changing commands out of the name
field and put them in the style. This assumes that all your top-level entries are actually headers.
Note that as from version 4.0, the style commands \glossarystyle
, \glossaryentryfield
and \glossarysubentryfield
are all deprecated. You can still use them but you'll get a warning. To update to the newer commands, you need to make the following substitutions:
\glossarystyle{
style-name}
-> \setglossarystyle{
style-name}
\glossaryentryfield{
label}{
name}{
description}{
symbol}{
location}
replace with:
\glossentry{
label}{
location}
- The name can be accessed with
\glossentryname{
label}
.
- The description can be accessed with
\glossentrydesc{
label}
.
- The symbol can be accessed with
\glossentrysymbol{
label}
.
- Other fields can be accessed with commands like
\glsentryuseri{
label}
described in section 9: Using Glossary Terms Without Links of the user manual.
\glossarysubentryfield{
level}{
label}{
name}{
description}{
symbol}{
location}
replace with:
\subglossentry{
level}{
label}{
location}
The fields can be accessed as above.
Here's a modified version that uses the newer commands and makes the top-level entries span both columns:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage[
nonumberlist,
nogroupskip,
nopostdot,
toc,
section]
{glossaries}
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolverzeichnis}
\newglossarystyle{superAB}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}
{%
\begin{longtable}[l]{@{}lp{\glsdescwidth}}%
}%
{%
\end{longtable}%
}%
\renewcommand{\glossentry}[2]{%
\tabularnewline
\multicolumn{2}{@{}l}%
{%
\glsentryitem{##1}%
\glstarget{##1}{\textbf{\large\glossentryname{##1}}}%
}%
\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
\glssubentryitem{##2}%
\glstarget{##2}{\glossentryname{##2}}%
&
\glossentrydesc{##2}\glspostdescription\space
##3\tabularnewline
}%
}%
\makeglossaries
\newglossaryentry{romanletter}{name={Lateinische Symbole},description={}}
\newglossaryentry{greekletter}{name={Griechische Symbole},description={}}
\newglossaryentry{symb:omega}{
name=$\Omega$,
description={Giergeschwindigkeit},
parent=greekletter,
sort=symbolomega,
type=symbolslist
}
\newglossaryentry{symb:M0}{
name=$M_{\mathrm{0}}$,
description={gemessenes Biegemoment mittels Vollmessbrücken DMS Schaltung},
parent=romanletter,
sort=symbolM0,
type=symbolslist
}
\glsaddall[types=symbolslist]
\begin{document}
\printglossary[type=symbolslist, style=superAB]
\end{document}
The result is:

The first column is now just wide enough to fit the widest sub-entry. A dotted leader can be added to the style with \dotfill
but it will be barely noticeable with just a single dot for the narrower symbol (omega).
Here's a variation that makes the left column 2cm wide and adds a leader:
\newglossarystyle{superAB}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}
{%
\begin{longtable}[l]{@{}p{2cm}p{\glsdescwidth}}%
}%
{%
\end{longtable}%
}%
\renewcommand{\glossentry}[2]{%
\tabularnewline
\multicolumn{2}{@{}l}%
{%
\glsentryitem{##1}%
\glstarget{##1}{\textbf{\large\glossentryname{##1}}}%
}%
\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
\glssubentryitem{##2}%
\glstarget{##2}{\glossentryname{##2}}%
\dotfill
&
\glossentrydesc{##2}\glspostdescription\space
##3\tabularnewline
}%
}%
This produces:

The gap between the columns can be shrunk by reducing the value of \tabcolsep
. For example:
\newglossarystyle{superAB}{%
\setglossarystyle{long}%
\renewenvironment{theglossary}
{%
\setlength{\tabcolsep}{2pt}%
\begin{longtable}[l]{@{}p{2cm}p{\glsdescwidth}}%
}%
{%
\end{longtable}%
}%
\renewcommand{\glossentry}[2]{%
\tabularnewline
\multicolumn{2}{@{}l}%
{%
\glsentryitem{##1}%
\glstarget{##1}{\textbf{\large\glossentryname{##1}}}%
}%
\tabularnewline
}%
\renewcommand{\subglossentry}[3]{%
\glssubentryitem{##2}%
\glstarget{##2}{\glossentryname{##2}}%
\dotfill
&
\glossentrydesc{##2}\glspostdescription\space
##3\tabularnewline
}%
}%
This produces:

Alternatively, you can remove it completely with @{}
in the column specifier:
\begin{longtable}[l]{@{}p{2cm}@{}p{\glsdescwidth}}%
Or to use up the entire line width:
\begin{longtable}[l]{@{}p{2cm}@{}p{\dimexpr\linewidth-2cm}@{}}%
The second method is to remove the hierarchy and have separate glossaries for each type of symbol and use the alttree
style. For example:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage[
nonumberlist,
nogroupskip,
nopostdot,
toc,
section]
{glossaries}
\newglossary*{greeklist}{Griechische Symbole}
\newglossary*{romanlist}{Lateinische Symbole}
\makeglossaries
\newglossaryentry{symb:omega}{
name=$\Omega$,
description={Giergeschwindigkeit},
sort=symbolomega,
type=greeklist
}
\newglossaryentry{symb:M0}{
name=$M_{\mathrm{0}}$,
description={gemessenes Biegemoment mittels Vollmessbrücken DMS Schaltung},
sort=symbolM0,
type=romanlist
}
\glsaddall[types={greeklist,romanlist}]
\begin{document}
\section*{Symbolverzeichnis}
\setupglossaries{section=subsection}
\setglossarystyle{alttree}
% Set up the way the name is displayed in the alttree style and how
% much space it takes up.
\glssetwidest{MMMM}
\renewcommand*{\glstreenamebox}[2]{% requires v4.19+
\makebox[#1][l]{#2\dotfill}%
}
\printglossary[type=greeklist]
\printglossary[type=romanlist]
\end{document}
This produces:

This method means that you manually order the two symbol lists, which makes it easier to have the Latin list before the Greek list if you prefer.
The third method is only available with the glossaries-extra
extension package using the group
field and \printunsrtglossary
. You can manually arrange the symbols so that they are listed in order of definition (no external tool required):
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyperref}
\usepackage[record,% make group field available
symbols,
style=alttreegroup,
nonumberlist]{glossaries-extra}
% Requires glossaries-extra.sty v1.14+
\glsxtrsetgrouptitle{greek}{Griechische Symbole}
\glsxtrsetgrouptitle{roman}{Lateinische Symbole}
\newglossaryentry{symb:omega}{
name=$\Omega$,
description={Giergeschwindigkeit},
type=symbols,
group=greek
}
\newglossaryentry{symb:M0}{
name=$M_{\mathrm{0}}$,
description={gemessenes Biegemoment mittels Vollmessbrücken DMS Schaltung},
type=symbols,
group=roman
}
% Set up the way the name is displayed in the alttree style and how
% much space it takes up.
\glssetwidest{MMMM}
\renewcommand*{\glstreenamebox}[2]{% requires v4.19+
\makebox[#1][l]{#2\dotfill}%
}
\begin{document}
% Requires glossaries-extra.sty v1.08+
\printunsrtglossary[type=symbols,title={Symbolverzeichnis}]
\end{document}
This produces:

If you want the sorting performed by an external tool, you can combine this method with bib2gls
but this is currently not available with Overleaf. (For a similar example, see the sample-textsymbols.tex
document described in the "Examples" chapter of the bib2gls
documentation.)
glossaries
do you have? (\glossarystyle
,\glossaryentryfield
and\glossarysubentryfield
were all deprecated in v4.0, so the answer depends on whether or not you need it to work with an old version.).log
file. On Overleaf there's an icon next to the "Recompile" button with the tooltip "Logs and output files". Click on that and then click on "View raw logs" to see the contents of the.log
file. The linePackage: glossaries 2016/04/30 v4.23 (NLCT)
indicates that the version number is 4.23, which is a bit out of date, but is new enough for the new glossary style commands.