2

I am using the glossaries-extra package to create a bilingual glossary. I want to use a modified version of the super style. However I can't flush the glossary entry list to the left side. How can I do it?

\documentclass[]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[
automake,
acronym,
nomain,
nopostdot=true,
nonumberlist,
]{glossaries-extra}


\makeglossaries

\newacronym[user1=interaural time difference]{itd}{ITD}{interaurale Zeitdifferenz}
\newacronym{iid}{IID}{interaurale Intensitätsdifferenz}

%% modsuper glossary display style
\newglossarystyle{modsuper}{%
\glossarystyle{super}%
\renewcommand{\glsgroupskip}{}%
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\[2pt]}%
}


\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\setabbreviationstyle[acronym]{long-short-user}
\renewcommand{\glsxtrpostdescacronym}{%
\ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
{ (\glscurrentfieldvalue)}%
{}%
}


\begin{document}

\tableofcontents

\section{Räumliches Hören}

Die \gls{itd} beschreibt die Zeitdifferenz zwischen den Ankunftszeiten des Schallsignals an den Ohren. Die \gls{iid} ist die Differenz der Schalldruckpegel zwischen beiden Ohren. \gls{itd} und \gls{iid} spielen beim räumlichen Hören eine wesentliche Rolle.

\printglossary[%
type=\acronymtype,
title=Akronyme und Abkürzungen,
toctitle=Akronyme und Abkürzungen,
style=modsuper,
]

\end{document}

enter image description here

Note: I would use the altree style as well. But there i didn't find out how to adjust the vertical space between the glossary entries.

2

The super style uses a (super)tabular with {lp{\glsdescwidth}} as tabular preamble. This gives a default margin of a \tabcolsep. You can suppress the margin with @{}:

\documentclass[]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[
automake,
acronym,
nomain,
nopostdot=true,
nonumberlist,
]{glossaries-extra}


\makeglossaries

\newacronym[user1=interaural time difference]{itd}{ITD}{interaurale Zeitdifferenz}
\newacronym{iid}{IID}{interaurale Intensitätsdifferenz}

%% modsuper glossary display style
\newglossarystyle{modsuper}{%
\glossarystyle{super}%
\renewenvironment{theglossary}%
    {\tablehead{}\tabletail{}%
     \begin{supertabular}{@{}lp{\glsdescwidth}}}%<----no margin
    {\end{supertabular}}%
\renewcommand{\glsgroupskip}{}%
\renewcommand*{\glossaryentryfield}[5]{%
\glsentryitem{##1}\glstarget{##1}{##2} & ##3\glspostdescription\space ##5\\[2pt]}%
}


\renewcommand{\glsnamefont}[1]{\textbf{#1}}
\setabbreviationstyle[acronym]{long-short-user}
\renewcommand{\glsxtrpostdescacronym}{%
\ifglshasfield{\glsxtruserfield}{\glscurrententrylabel}%
{ (\glscurrentfieldvalue)}%
{}%
}


\begin{document}

\tableofcontents

\section{Räumliches Hören}

Die \gls{itd} beschreibt die Zeitdifferenz zwischen den Ankunftszeiten des Schallsignals an den Ohren. Die \gls{iid} ist die Differenz der Schalldruckpegel zwischen beiden Ohren. \gls{itd} und \gls{iid} spielen beim räumlichen Hören eine wesentliche Rolle.

\printglossary[%
type=\acronymtype,
title=Akronyme und Abkürzungen,
toctitle=Akronyme und Abkürzungen,
style=modsuper,
]

\end{document}

enter image description here

  • Thank you. That was exactly what I was looking for. Is it possible to fit the glossary width to the textwidth by using for e.g. something like "X" definition from the tabularx environment? – Lukas Feb 19 '18 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.