| 1 |
% This file is public domain |
| 2 |
% If you want to use arara, you need the following directives: |
| 3 |
% arara: pdflatex: { synctex: on } |
| 4 |
% arara: makeglossaries |
| 5 |
% arara: pdflatex: { synctex: on } |
| 6 |
% arara: pdflatex: { synctex: on } |
| 7 |
% |
| 8 |
%http://mirrors.ctan.org/macros/latex/contrib/glossaries/glossaries-user.html#sample-prefix |
| 9 |
|
| 10 |
\documentclass{article} |
| 11 |
|
| 12 |
\usepackage[colorlinks]{hyperref} |
| 13 |
\usepackage[toc,acronym]{glossaries-prefix} |
| 14 |
|
| 15 |
\makeglossaries |
| 16 |
|
| 17 |
\newglossaryentry{sample}{name={sample}, |
| 18 |
description={an example}, |
| 19 |
prefix={a~}, |
| 20 |
prefixplural={the\space}% |
| 21 |
} |
| 22 |
|
| 23 |
\newglossaryentry{oeil}{name={oeil}, |
| 24 |
plural={yeux}, |
| 25 |
description={eye}, |
| 26 |
prefix={l'}, |
| 27 |
prefixplural={les\space}} |
| 28 |
|
| 29 |
\newacronym |
| 30 |
[% |
| 31 |
prefix={an\space},% |
| 32 |
prefixfirst={a~}% |
| 33 |
]{svm}{SVM}{support vector machine} |
| 34 |
|
| 35 |
\newglossaryentry{noprefix}{name={no prefix},plural={no prefixes}, |
| 36 |
description={entry without prefix}} |
| 37 |
|
| 38 |
\newglossarystyle{plist}{% |
| 39 |
\setglossarystyle{list}% |
| 40 |
\renewcommand*{\glossentry}[2]{% |
| 41 |
\item[\glsentryitem{##1}% |
| 42 |
\glstarget{##1}% |
| 43 |
{% |
| 44 |
\ifglshasprefix{##1}% |
| 45 |
{\Glsentryprefix{##1}\glsprefixsep\glossentryname{##1}}% |
| 46 |
{\Glossentryname{##1}}% |
| 47 |
}] |
| 48 |
\glossentrydesc{##1}\glspostdescription\space ##2}% |
| 49 |
} |
| 50 |
|
| 51 |
\begin{document} |
| 52 |
|
| 53 |
\tableofcontents |
| 54 |
|
| 55 |
\section{Sample} |
| 56 |
|
| 57 |
First use: \pgls{sample}, \pgls{svm}, \pgls{oeil}, \pgls{noprefix}. Next use: |
| 58 |
\pgls{sample}, \pgls{svm}, \pgls{oeil}, \pgls{noprefix}. |
| 59 |
|
| 60 |
Reset. \glsresetall |
| 61 |
|
| 62 |
First use: \pglspl{sample}, \pglspl{svm}, \pglspl{oeil}, \pglspl{noprefix}. Next use: |
| 63 |
\pglspl{sample}, \pglspl{svm}, \pglspl{oeil}, \pglspl{noprefix}. |
| 64 |
|
| 65 |
Reset. \glsresetall |
| 66 |
|
| 67 |
First use: \Pgls{sample}, \Pgls{svm}, \Pgls{oeil}, \Pgls{noprefix}. Next use: |
| 68 |
\Pgls{sample}, \Pgls{svm}, \Pgls{oeil}, \Pgls{noprefix}. |
| 69 |
|
| 70 |
Reset. \glsresetall |
| 71 |
|
| 72 |
First use: \Pglspl{sample}, \Pglspl{svm}, \Pglspl{oeil}, \Pglspl{noprefix}. Next use: |
| 73 |
\Pglspl{sample}, \Pglspl{svm}, \Pglspl{oeil}, \Pglspl{noprefix}. |
| 74 |
|
| 75 |
Reset. \glsresetall |
| 76 |
|
| 77 |
First use: \PGLS{sample}, \PGLS{svm}, \PGLS{oeil}, \PGLS{noprefix}. Next use: |
| 78 |
\PGLS{sample}, \PGLS{svm}, \PGLS{oeil}, \PGLS{noprefix}. |
| 79 |
|
| 80 |
Reset. \glsresetall |
| 81 |
|
| 82 |
First use: \PGLSpl{sample}, \PGLSpl{svm}, \PGLSpl{oeil}, \PGLSpl{noprefix}. Next use: |
| 83 |
\PGLSpl{sample}, \PGLSpl{svm}, \PGLSpl{oeil}, \PGLSpl{noprefix}. |
| 84 |
|
| 85 |
\printglossary[style=plist] |
| 86 |
\printacronyms |
| 87 |
\end{document} |