0

everybody. I'm new to the site, so I greet everyone. Sorry for my English: I'm not mother language so, I really I appeal to your patience.

My problem consists in difficulties to format my glossaries in a book. I’m using the “LIST style”, and I’d like to reduce the fixed space between the definitions. I tried in many ways but I wasn’t able to find a solutions. I’m worrying it’s not applicable to the style I’m using. This is the (simplified) code.

\documentclass[11pt]{book}  
\usepackage[T1]{fontenc} % enable Cork Encoding
\usepackage[utf8]{inputenc}

\usepackage[greek.ancient,latin,italian]{babel}
\languageattribute{latin}{withprosodicmarks}
\usepackage{hyperref}

\usepackage[nogroupskip]{glossaries-extra}
\setglossarystyle{list}
%\usepackage[xindy]{imakeidx}

\newglossary*{prova}{Glossario del primo capitolo}
\newglossary*{prova2}{Glossario del secondo capitolo}

\newglossarystyle{mylist}{%
    \setglossarystyle{list}% base this style on the list style
    \renewcommand*{\glossaryheader}{}%
    \renewcommand*{\glsgroupheading}[1]{}%
    \renewcommand*{\glossentry}[2]{%
        \item[\glsentryitem{##1}%
        \glstarget{##1}{\glossentryname{##1}}]% 
        \glspostdescription\space (\textit{Pag. ##2}): %
        \small{\glossentrydesc{##1}} }%
}

\renewcommand*{\glsclearpage}{}%dovrebbe sopprimere il salto pagina prima del glossario

\makenoidxglossaries 
\glsaddall % sistema i numeri di pagina

\input{file-glossario}

\title{Prova glossario}
\author{ }
\date{ }

\begin{document}
\frontmatter                           
\maketitle                             
\mainmatter

\setglossarystyle{mylist} 

\chapter{prova}
    non  un \gls{Pippo} qualsiasi. Intorno gira abbaiando \gls{Pluto}, e fanno chiasso \gls{Qui}, \gls{Quo} e \gls{Qua}.

    \printnoidxglossary[type=prova]

\chapter{secondo capitolo}
    un tentativo con la parola \gls{Definizione} che non riesce a comprendere tutte le \glspl{Definizione}, e c'è il libero \gls{Arbitrio}.
    Tra i colori e le loro \glspl{Definizione}, c'è pure l'antico termine  \glsuseri{Rubro}.

    \printnoidxglossary[type=prova2]

\end{document}

As you can see I use an external .tex to include the definitions. I've also renewed the style, but it has no impact on the line spacing. can anyone suggest something to me?

Additional question: do you know how to format the golssaies' titles'

Thanks in advance.

  • Just to clarify: I think that the "LIST style" in Glossaries is a description list environment that probably could me modified using the enumitem package's commands. Maybe someone could explain me something about it... – BennyB Sep 11 '19 at 7:52
0

Well, I found a solution on my own.

I post it because it could be useful to someone in the future. Basically, I discovered that in glossaries-extra, the LIST STYLE is a description itemize's enviroment, so I applied the enumitem package, and its commands.

As I don't have other itemized lists in the document, I used a global command, and it worked correctly. This is the additional code:

\usepackage{enumitem}
\setlist[description]{itemsep=0.1ex, leftmargin=0cm,rightmargin=0cm}

The leftmargin and rightmargin command work on the horizontal space, and I used them to align the descriptions to the borders.

In real, looking to my question, the correct command should have been the following:

\setlist[description]{noitemsep}

which effectively suppresses any space in the list.

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.