I'm using the glossaries
package to enter acronyms, in an scrbook
document. For now, I'm using \gls
in the text, and \acrshort
& \acrlong
in tables (to manually control the form).
Because I use a lot of acronyms in my thesis, I would like LaTeX, when using \gls
, to display the long version of the acronym in the margin (right or left since it is a two side document, and with the possibility to make the text smaller), along the paragraph, except for the first time in each chapter since the long version is automatically entered in the text, and only in the \mainmatter
.
Here is a MWE :
\documentclass[chapterprefix,twoside,12pt,DIV=12]{scrbook}
\KOMAoptions{headsepline=true, chapterprefix=true}
\usepackage{lmodern}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{setspace}
\setstretch{1.5}
\usepackage[bottom]{footmisc}
\usepackage[acronym,smallcaps]{glossaries}
\makeglossaries
\newglossarystyle{long-ucdesc}{%
\setglossarystyle{long}%
\renewcommand{\glossentry}[2]{%
\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
\Glossentrydesc{##1}\glspostdescription\space ##2\tabularnewline
}%
}
\newacronym{unesco}{unesco}{United Nations Educational, Scientific and Cultural Organization}
\begin{document}
\frontmatter
\mainmatter
\gls{unesco} ......
\gls{unesco}
\appendix
\backmatter
\printglossary[type=acronym, style=long]\label{listofacronyms}
\end{document}
I have no idea where to start to do this. I see that the package marginnote
can do something close with notes, but that's it.
EDIT: I see that some have used the package glossaries-extra
, for instance the answer here, but I can't make it work (some functions seem deprecated).