0

I would like to remove the indentation of long text in the description of a glossary entry. Actually a really simple task but I can not find the solution. Somehow \glossentrydesc{##1} does the indentation automatically. I would prefer a solution without the definition of a new style but I am open to do that.

Here a MWE:

\documentclass{scrbook}
\usepackage{hyperref}
\usepackage[acronym = true]{glossaries-extra}    
\makeglossaries

\newglossarystyle{mylong}{  
    \renewenvironment{theglossary}
    {\begin{longtable}{lp{\glsdescwidth}}}
        {\end{longtable}}

    \renewcommand*{\glossaryheader}{}
    \renewcommand*{\glsgroupheading}[1]{}
    \renewcommand{\glossentry}[2]{

        \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}}                 &
        \glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline
    }%
    \renewcommand{\subglossentry}[3]{
        &
        \glssubentryitem{##2}
        \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription\space
        ##3\tabularnewline
    }   
    \ifglsnogroupskip
    \renewcommand*{\glsgroupskip}{}%
    \else
    \renewcommand*{\glsgroupskip}{ & \tabularnewline}%
    \fi
}

\renewcommand\glspostdescription{\dotfill}
\setlength{\glsdescwidth}{0.95\hsize}   


\longnewglossaryentry{apig}{
    name        =   {API},
    description =   {
        An Application Programming Interface (API) is a particular set  of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API
}}

\newglossaryentry{api}{
    type        =   \acronymtype, 
    name        =   {API}, 
    description =   {Application Programming Interface},
    first       =   {Application Programming Interface (API) \glsadd{apig}}}


\begin{document}

    \printglossary[
    type            =   \acronymtype,
    style           =   long,
    title           =   Acronym,
    toctitle        =   Acronym,
    nonumberlist    =   false
    ]   

    \printglossary[
    type            =   main,
    style           =   mylong,
    title           =   Glossar,
    toctitle        =   Glossar,
    nonumberlist    =   false
    ]
    \newpage
    \section{Sec1}
    \gls{api}
    \newpage
    \gls{api}
    \newpage
    \gls{api}
    \newpage
    \section{Sec2}  
    \gls{api}
\end{document}

enter image description here

schtandard
  • 14,892

1 Answers1

1

That indentation is called a space and you inserted it yourself:

\longnewglossaryentry{apig}{
    name        =   {API},
    description =   {
        An Application Programming Interface (API) is a particular set  of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API
}}

Just remove the space:

\longnewglossaryentry{apig}{
    name        =   {API},
    description =   {%
        An Application Programming Interface (API) is a particular set  of rules and specifications that a software program can follow to access and make use of the services and resources provided by another particular software program that implements that API
}}

Why does this make a difference? See this answer.

schtandard
  • 14,892