1

I am using the Glossaries package with the style index to build my abbreviations and symbols list. So far, my solution is working (almost) fine but I am facing one problem. With the index style, there is just a blank between the gls entry name and the gls description which does not look suitable for me.

Glossary with index style

Is it possible to adjust the gls entry description on the left side equally for each entry with this style?

I would like to have it like this but with the same vertical spacing like the index style:

Glossary with alttree style

I tried different styles, table styles (longtable) as well which solved this problem but opened other problems (vertical spacing). Therefore, the index style is currently the best style for me.

Also I tried to add some horizontal spacing with the following code which just moved the description to the right but did not adjust the description:

\renewcommand{\glsnamefont}[1]{\textbf{\bfseries #1 \quad}}

Attached my main.tex:

\documentclass{DissOnlineLatex}

\begin{document}

\pagestyle{scrheadings}
\ohead[]{\headmark}
\ihead[]{}
\chead[]{}
\ofoot[]{\pagemark}
\ifoot[]{}
\cfoot[]{}
\automark[chapter]{chapter}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\tableofcontents
\newpage

\pagenumbering{arabic}

\include{chapterA}
\include{chapterB}

\printbibliography[heading=bibintoc,title=Literaturverzeichnis]

\cleardoublepage
\printglossary[type=\acronymtype,style=index,title=Abkürzungsverzeichnis] % index indexgroup alttreegroup

\cleardoublepage
\printglossary[type=symbolslist,style=index,title=Symbolverzeichnis] % index alttree

\cleardoublepage
\makeatletter \renewcommand{\@dotsep}{1} \makeatother
\listoffigures
\addcontentsline{toc}{chapter}{\listfigurename}

\cleardoublepage
\listoftables
\addcontentsline{toc}{chapter}{\listtablename}

\cleardoublepage
\listofequations
\addcontentsline{toc}{chapter}{Formelverzeichnis}

\cleardoublepage
\printglossary[style=owngloss,nonumberlist,title=Glossar]

\end{document}

Here the glossaries part of my documentclass DissOnlineLatex.cls

\usepackage[ 
toc,         
acronym,
nopostdot,
sort=standard   
]{glossaries}

%\renewcommand{\glossarypreamble}{\glsfindwidesttoplevelname[\acronymtype]}
%\renewcommand{\glsnamefont}[1]{\textbf{\bfseries #1}}

\renewcommand*\glspostdescription{\dotfill}

\newglossarystyle{owngloss}{%
    \setglossarystyle{treegroup}%
    \renewcommand*{\glossentry}[2]{%
        \glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}%
        \\ \glossentrydesc{##1} \\ \par
    }%
}

\newglossary[slg]{symbolslist}{syi}{syg}{} % create add. symbolslist
\loadglsentries{ap_glossar.tex}
\loadglsentries{acronyms.tex}
\loadglsentries{symbols.tex}
\makeglossaries

Here a part of the defined abbreviations:

\newacronym{a:aktual.}{aktual.}{aktualisiert}
\newacronym[longplural={Auflagen},shortplural={Aufl.}]{a:Aufl.}{Aufl.}{Auflage}
\newacronym[longplural={Bänder},shortplural={Bd.}]{a:Bd.}{Bd.}{Band}
\newacronym{a:bearb.}{bearb.}{bearbeitet}
\newacronym{a:bspw.}{bspw.}{beispielsweise}
\newacronym{a:bzw.}{bzw.}{beziehungsweise}
\newacronym{a:ca.}{ca.}{circa}
\newacronym{a:d.h.}{d.h.}{das heißt}
\newacronym{a:DIN}{DIN}{Deutsches Institut für Normung e. V.}
\newacronym[longplural={Dissertationen},shortplural={Diss.}]{a:Diss.}{Diss.}{Dissertation}
5
  • I am sorry. Just forgot to say "Hello" and "Thanks in advance for any hints." :-)
    – HB4711
    Sep 13, 2017 at 16:54
  • Welcome to TeX.SE! It would help to have a complete document (including \documentclass and \begin{document}...\end{document} with some example definitions). You can use \loadglsentries[\acronymtype]{example-glossaries-acronym} \loadglsentries[symbolslist]{example-glossaries-brief} and \glsaddall for some dummy entries if you like. Sep 13, 2017 at 16:59
  • Hello Nicola, thanks for the fast reply! I added the coding in my original question above.
    – HB4711
    Sep 13, 2017 at 18:27
  • A minimal working example (MWE) needs to be a complete self-contained file (with a class in the TeX distributions) that can easily be copied and pasted to test it. (If people have to patch together code fragments to create an example file, it puts them off trying to solve the problem.) Sep 14, 2017 at 18:26
  • Hello Nicola, I just found an appropriate solution. Now I am using the alttree style instead of the index style. I posted the solution below.
    – HB4711
    Sep 15, 2017 at 7:45

1 Answer 1

3

I found an appropriate solution. I am now using the alttree style and added

\renewcommand{\glossarypreamble}{\glsfindwidesttoplevelname[\acronymtype] \setlength{\parskip}{0pt}}

in my .cls document class. Compared to my .cls class above, I have now the following glossaries block:

\usepackage[ 
toc,         
acronym,
nopostdot,
sort=standard   
]{glossaries}

\renewcommand{\glossarypreamble}{\glsfindwidesttoplevelname[\acronymtype] \setlength{\parskip}{0pt}} % <--------- THAT IS THE KEY, NOW USING alttree style.

\renewcommand*\glspostdescription{\dotfill}

\newglossarystyle{owngloss}{%
    \setglossarystyle{treegroup}%
    \renewcommand*{\glossentry}[2]{%
        \glsentryitem{##1}\textbf{\glstarget{##1}{\glossentryname{##1}}}%
        \\ \glossentrydesc{##1} \\ \par
    }%
}

\newglossary[slg]{symbolslist}{syi}{syg}{} % create add. symbolslist
\loadglsentries{ap_glossar.tex}
\loadglsentries{acronyms.tex}
\loadglsentries{symbols.tex}
\makeglossaries

In my main.tex, I am using the alttree style:

\documentclass{DissOnlineLatex}

\begin{document}

\pagestyle{scrheadings}
\ohead[]{\headmark}
\ihead[]{}
\chead[]{}
\ofoot[]{\pagemark}
\ifoot[]{}
\cfoot[]{}
\automark[chapter]{chapter}

\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}

\tableofcontents
\newpage

\pagenumbering{arabic}

\include{chapterA}
\include{chapterB}

\printbibliography[heading=bibintoc,title=Literaturverzeichnis]

\cleardoublepage
\printglossary[type=\acronymtype,style=alttree,title=Abkürzungsverzeichnis] % index indexgroup alttreegroup

\cleardoublepage
\printglossary[type=symbolslist,style=alttree,title=Symbolverzeichnis] % index alttree

\cleardoublepage
\makeatletter \renewcommand{\@dotsep}{1} \makeatother
\listoffigures
\addcontentsline{toc}{chapter}{\listfigurename}

\cleardoublepage
\listoftables
\addcontentsline{toc}{chapter}{\listtablename}

\cleardoublepage
\listofequations
\addcontentsline{toc}{chapter}{Formelverzeichnis}

\cleardoublepage
\printglossary[style=owngloss,nonumberlist,title=Glossar]

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .