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

PascalS
  • 826

1 Answers1

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

egreg
  • 1,121,712