2

Consider the MWE below (mystyle credit post here for increasing the horizontal spacing).

How can I change mystyle, so that the indentation is the same for multiple lines (red lines), and how can I change so that all entries on a page are aligned (green line)?

Is it e.g. possible to specify 5 cm width for the name/key. If it is longer it is broken (paragraph wrap like "p" in tables) in multiple rows.

So I am looking for a 'table' style for glossary.

Thanks

enter image description here

MWE

\documentclass{book}
\usepackage[savewrites,nonumberlist, seeautonumberlist]{glossaries}
\usepackage{glossary-mcols}
\newglossarystyle{mystyle}{%
  \glossarystyle{list}%
  \renewcommand*{\glossaryentryfield}[5]{%
    \item[\glsentryitem{##1}\glstarget{##1}{##2}]%
       \hspace{1cm}##3\glspostdescription\space ##5}%
}
\makeglossaries
\newglossaryentry{examp}{name={Short},%
    description={Just showing what I mean},%
}
\newglossaryentry{examp2}{name={A bit longer},%
    description={asd asd ad das dsd asd asd ads das dasdsa das das dsa das das dsa dsa dsa dsa d as asddas ads dsa das dsa as sda dsa dsa dsa d sa dsa dsa},%
}

\begin{document}
\printglossary[style=mystyle]
\end{document}
3

You can use a style based upon the long style (which actually is a longtable. I used 3cm instead of 5cm; that looks enough.

\documentclass{book}
\usepackage[savewrites,nonumberlist, seeautonumberlist]{glossaries}
\newglossarystyle{mystyle}{%
  \glossarystyle{long}%
  \renewenvironment{theglossary}%
     {\begin{longtable}{p{3cm}p{\glsdescwidth}}}%
     {\end{longtable}}%
}

\makeglossaries
\newglossaryentry{examp}{name={Short},%
    description={Just showing what I mean},%
}
\newglossaryentry{examp2}{name={A bit longer},%
    description={asd asd ad das dsd asd asd ads das dasdsa das das dsa das das dsa dsa dsa dsa d as asddas ads dsa das dsa as sda dsa dsa dsa d sa dsa dsa},%
}

\begin{document}
\glsaddall
\printglossary[style=mystyle]
\end{document}

enter image description here

1
  • 1
    How to add this same style per chapter glossary, acronym etc. I want to add this style super per chapter glossary
    – Deb bijan
    Aug 15 '18 at 7:07

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.