2

Refer to this post, I try to adapt my list of symbols to my list of abbreviations.

List of abbreviations

% Setup list of abbreviations
\newglossarystyle{mylong}{
\setglossarystyle{long}
\renewenvironment{theglossary}{\vspace{-3mm}\begin{longtable*}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{0.8\hsize}}}{\end{longtable*}}}

\printglossary[style=mylong,type=\acronymtype,title=Abkürzungsverzeichnis]

List of abbreviations

Now I would like to achieve a quite similar presentation for my list of symbols.

List of symbols

\newglossary{symbolslist}{syi}{syg}{}
\glsaddstoragekey{unit}{}{\glsentryunit}

\newglossarystyle{symbunitlong}{
\setglossarystyle{long3col}
\renewenvironment{theglossary}{\vspace{-3mm}
\begin{longtable*}[l]{lp{\glsdescwidth}>{\arraybackslash}p{1cm}}}{\end{longtable*}}
\renewcommand*{\glossentry}[2]{
\glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1} & \glsentryunit{##1}\\
}
}

\printunsrtglossary[type=symbols,style=symbunitlong,title=Symbolverzeichnis]

List of symbols

How to left align the list of symbols and how to adapt the distance between my symbols to the distance from CAD to CRC?

EDIT1

To solve the problem with the vertical distance I have just to add a sort property to the definition of a new symbol like this:

\glsxtrnewsymbol[
description={test1},
unit={m},
sort={a}]
{y}{y}

Thanks to @leandriis for more information see this post.

EDIT2

If I change the line to this like mentioned of @leandriis

\begin{longtable*}[l]{@{}lp{\glsdescwidth}>{\arraybackslash}p{1cm}}}{\end{longtable*}}

It seems to be better but not perfect

enter image description here

EDIT3

MWE

\documentclass[]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[binary-units=true,locale = DE]{siunitx}
\usepackage{caption}
\usepackage[nonumberlist,acronym,toc,symbols,nomain]{glossaries-extra}

\usepackage{showframe} % just for the example

% Setup list of abbreviations
\newglossarystyle{mylong}{
  \setglossarystyle{long}
  \renewenvironment{theglossary}{%
    \vspace{-3mm}%
    \begin{longtable*}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{\dimexpr\textwidth-\tabcolsep-2cm}@{}}%
  }{\end{longtable*}}
}
\setabbreviationstyle[acronym]{long-short}

\newacronym[
plural={Test},
firstplural={Test (Test)},
description={Test}]
{Test}{Test}{Test}

\newacronym[
plural={Test1},
firstplural={Test1 (Test1)},
description={Test1}]
{Test1}{Test1}{Test1}

% Setup list of symbols
\newglossary{symbolslist}{syi}{syg}{}
\glsaddstoragekey{unit}{}{\glsentryunit}
\newglossarystyle{symbunitlong}{
\setglossarystyle{long3col}
\renewenvironment{theglossary}{\vspace{-3mm}\begin{longtable*}[l]{@{}p{\dimexpr 2cm-\tabcolsep}p{\glsdescwidth}>{\arraybackslash}p{1cm}}}{\end{longtable*}}

\renewcommand*{\glossentry}[2]{
\glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1} & \glsentryunit{##1}\\
}
}

\glsxtrnewsymbol[
description={test0},
unit={m},
sort={a}]
{x}{x}

\glsxtrnewsymbol[
description={test1},
unit={m},
sort={a}]
{y}{y}

\makeglossaries

\glsadd{x}
\glsadd{y}
\glsadd{Test}
\glsadd{Test1}

\begin{document}
\printglossary[type=\acronymtype,style=mylong,title=Abkürzungsverzeichnis]

\printunsrtglossary[type=symbols,style=symbunitlong,title=Symbolverzeichnis]
\end{document}

RESULT

enter image description here enter image description here

  • The vertical spacing between the shown entries might be due to grouping with redard to the first letter. See here: How do I remove alphabetical grouping of acronyms in the list? – leandriis Aug 12 '19 at 14:00
  • To remove the horizontal indentation, you could add @{} to {lp{\glsdescwidth}>{\arraybackslash}p{1cm}}} as follows: {@{}lp{\glsdescwidth}>{\arraybackslash}p{1cm}}} (See also What is the use of @{}?) – leandriis Aug 12 '19 at 14:02
  • Due to the lack of a complete MWE my above comments were just pure guesses. Could you therefore please edit your question to include a full minimal working example (MWE) that allows others to reproduce the issue you describe? – leandriis Aug 12 '19 at 14:29
3

Don't guess the width and redefine the left distance:

\documentclass[]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage[binary-units=true,locale = DE]{siunitx}
\usepackage{caption}
\usepackage[nonumberlist,acronym,toc,symbols,nomain]{glossaries-extra}

\usepackage{showframe} % just for the example

% Setup list of abbreviations
\newglossarystyle{mylong}{
  \setglossarystyle{long}
  \renewenvironment{theglossary}{%
    \vspace{-3mm}%
    \begin{longtable*}{
      @{}
      p{\dimexpr 2cm-\tabcolsep}
      p{\dimexpr\textwidth-\tabcolsep-2cm}
      @{}
    }%
  }{\end{longtable*}}
}
\setabbreviationstyle[acronym]{long-short}

% Setup list of symbols
\newglossary{symbolslist}{syi}{syg}{}
\glsaddstoragekey{unit}{}{\glsentryunit}
\newglossarystyle{symbunitlong}{
  \setglossarystyle{long3col}%
  \renewenvironment{theglossary}{%
    \vspace{-3mm}%
    \setlength{\LTleft}{0pt}%
    \begin{longtable*}{%
      @{}
      p{\dimexpr 2cm-\tabcolsep}
      p{\glsdescwidth}
      r
      @{}
    }%
  }{\end{longtable*}}
  \renewcommand*{\glossentry}[2]{%
    \glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1} & \glsentryunit{##1}\\
  }%
}

\newacronym[
plural={Test},
firstplural={Test (Test)},
description={Test}]
{Test}{Test}{Test}

\newacronym[
plural={Test1},
firstplural={Test1 (Test1)},
description={Test1}]
{Test1}{Test1}{Test1}


\glsxtrnewsymbol[
description={test0},
unit={m},
sort={a}]
{x}{x}

\glsxtrnewsymbol[
description={test1},
unit={m},
sort={a}]
{y}{y}

\makeglossaries

\glsadd{x}
\glsadd{y}
\glsadd{Test}
\glsadd{Test1}

\begin{document}
\printglossary[type=\acronymtype,style=mylong,title=Abkürzungsverzeichnis]

\printunsrtglossary[type=symbols,style=symbunitlong,title=Symbolverzeichnis]
\end{document}

Don't forget \usepackage[T1]{fontenc}

enter image description here

enter image description here

| improve this answer | |
  • Thanks for your answer, but the problem is located in the list of symbols not in the list of abbreviations. – PascalS Aug 12 '19 at 15:06
  • @Passe Similar to the above – egreg Aug 12 '19 at 15:18
  • Gotcha! Thanks you! – PascalS Aug 12 '19 at 15:33

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.