summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glosmathtools
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/glosmathtools
Initial commit
Diffstat (limited to 'macros/latex/contrib/glosmathtools')
-rw-r--r--macros/latex/contrib/glosmathtools/README.md30
-rw-r--r--macros/latex/contrib/glosmathtools/glosmathtools.sty413
-rw-r--r--macros/latex/contrib/glosmathtools/sample_glosmathtools.pdfbin0 -> 369524 bytes
-rw-r--r--macros/latex/contrib/glosmathtools/sample_glosmathtools.tex111
-rw-r--r--macros/latex/contrib/glosmathtools/sample_glosmathtools_glos.tex162
5 files changed, 716 insertions, 0 deletions
diff --git a/macros/latex/contrib/glosmathtools/README.md b/macros/latex/contrib/glosmathtools/README.md
new file mode 100644
index 0000000000..906422c625
--- /dev/null
+++ b/macros/latex/contrib/glosmathtools/README.md
@@ -0,0 +1,30 @@
+# Package glosmathtools
+
+The `glosmathtools` package can be used to generate a mathematical
+nomenclature (also called list of symbols or notation). It is based
+on the `glossaries` package.
+
+The main features are:
+- symbol categories (e.g.: latin, greek)
+- automatic but customizable symbol sorting
+- easy subscript management
+- easy accentuation managment
+- abbreviation support (with first use definition)
+- bilangual nomenclatures (for bilangual documents)
+- bilangual abbreviations
+
+At the time being, the documentation is based on `ulthese` class and
+in french only.
+
+## Licence
+
+LaTeX Project Public License, version 1.3c or (at your option) any
+later version.
+
+## Version
+
+0.5.1 (2019-08-02)
+
+## Author
+
+Francis Gagnon <franckgaga2@gmail.com>
diff --git a/macros/latex/contrib/glosmathtools/glosmathtools.sty b/macros/latex/contrib/glosmathtools/glosmathtools.sty
new file mode 100644
index 0000000000..c117579d29
--- /dev/null
+++ b/macros/latex/contrib/glosmathtools/glosmathtools.sty
@@ -0,0 +1,413 @@
+% !TeX spellcheck = en_US
+% !TeX encoding = UTF-8
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glosmathtools}%
+[%
+2019/08/02 v0.5.1 %
+Mathematical nomenclature tools based on glossaries package %
+Francis Gagnon %
+]%
+\RequirePackage{amsmath,amsfonts,etoolbox}%
+
+% ===========================================================================
+% =================== PACKAGE OPTIONS =======================================
+% ===========================================================================
+% define char <"> as shortcut for "sbu" macro in math mode
+% and define qtmark macro to show the quotation mark character
+\DeclareOption{qtmarkupright}{%
+ \begingroup\lccode`~=`"\lowercase{\endgroup\def~}#1{\sbu{#1}}%
+ \mathchardef\qtmark=\mathcode`"\AtBeginDocument{\mathcode`"=\string"8000}%
+}%
+
+% single lineskip nomenclature (memoir/setspace package required)
+\newtoggle{glosmath@singlelineskip}%
+\DeclareOption{singlelineskip}{\toggletrue{glosmath@singlelineskip}}%
+
+%% using opperators/accents without nomenclature definitions
+\newtoggle{glosmath@nodefop}%
+\DeclareOption{nodefop}{\toggletrue{glosmath@nodefop}}%
+
+%% other options are passed to glossaires package
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{glossaries}}%
+
+\ProcessOptions\relax%
+% noredefwarn to supress warnings with memoir class redifintion
+\RequirePackage[noredefwarn]{glossaries}%
+
+% checkup if memoir or setspace is loaded with singlelineskip option
+\iftoggle{glosmath@singlelineskip}{%
+ \@ifclassloaded{memoir}{\relax}{%
+ \@ifpackageloaded{setspace}{\relax}{%
+ \PackageError{glosmathtools}%
+ {memoir class ot setspace package must be %
+ loaded for singlelineskip option}{}%
+ }%
+ }%
+}%
+
+% ===========================================================================
+% =================== PUBLIC MACROS =========================================
+% ===========================================================================
+% ---------- sbu -------------------------------------------------------
+% "sbu" macro : shortcut for upright indices (ISO/NIST standard
+% operatorfont for main document math font (serif or sans)
+\newcommand*{\sbu}[1]{_{\operatorfont{#1}}}%
+
+% ---------- newglosentrymath --------------------------------------------
+% new glossary entry by adding ensuremath macro in the name field
+% 3 arguments : glossary label, math symbol and {key=value list}
+\newcommand*{\newglosentrymath}[3]%
+{%
+ \newglossaryentry{#1}{name={\ensuremath{#2}},#3}%
+}%
+
+% ---------- glscatnamefmt ------------------------------------------------
+% symbol category title format, default to glstreenamefmt
+% redefine to change the format style
+\newcommand*{\glscatnamefmt}[1]{\glstreenamefmt{#1}}
+
+% ---------- glsac --------------------------------------------------------
+% show $a$ with optionnal argument for accents
+\newcommand*{\glsac}[2][]%
+{%
+ \glosmath@getMyGlsMacro{#1}%
+ \ensuremath{\glsdisp{#2}{\glosmath@MyGlsMacro{#2}}}%
+}%
+
+% ---------- glsvi -------------------------------------------------------
+% show $a_b$ with link to "a" and variable "b"
+% 4 arguments : 2 mandatory arguments and optional 1st and 2nd argument
+% for adding accent on "a" and "b"
+\newcommand*{\glsvi}[1][]%
+{%
+ \def\glosmath@ArgI{#1}%
+ \glosmath@glsviRelay%
+}%
+
+% ---------- glsub -------------------------------------------------------
+% show $a_b$ with link to "a" and subscript "sub.b"
+% 3 arguments : 2 mandatory arguments and optional 1st argument
+% for adding accents on "a"
+\newcommand*{\glsub}[3][]%
+{%
+ \glosmath@getMyGlsMacro{#1}%
+ \ensuremath{\glsdisp{#2}{\glosmath@MyGlsMacro{#2}_{\gls{sub.#3}}}}%
+}%
+
+% ---------- glsubs -------------------------------------------------------
+% show $a_{b,c}$ with link "a", "sub.b" and "sub.c"
+% 4 arguments : 4 mandatory arguments and optional 1st argument
+% for adding accents on "a" (dot,bar,hat or tilde)
+\newcommand*{\glsubs}[4][]%
+{%
+ \glosmath@getMyGlsMacro{#1}%
+ \nottoggle{glosmath@nodefop}{\glsadd{op.comma}}{}%
+ \ensuremath{%
+ \glsdisp{#2}{%
+ \glosmath@MyGlsMacro{#2}_{\gls{sub.#3},\gls{sub.#4}}%
+ }%
+ }%
+}%
+
+% ---------- glslang -----------------------------------------------------
+% show full accronyms definition in specified languages
+\newcommand*{\glslang}[2][]%
+{%
+ \let\glosmath@oldacrlang\glosmath@acrlang%
+ \notblank{#1}{\setacronymlang{#1}}{}%
+ \gls{#2}%
+ \expandafter\setacronymlang\expandafter{\glosmath@oldacrlang}%
+}%
+
+% ---------- setacronymlang -----------------------------------------------
+% set accronym definition to specified language(s)
+\newcommand*{\setacronymlang}[1]%
+{%
+ \ifstrequal{#1}{L1}{\glosmath@setLone}%
+ {%
+ \ifstrequal{#1}{L2}{\glosmath@setLtwo}%
+ {%
+ \ifstrequal{#1}{L1L2}{\glosmath@setLoneLtwo}%
+ {%
+ \ifstrequal{#1}{L2L1}{\glosmath@setLtwoLone}%
+ {%
+ \PackageError{glosmathtools}{Unknown accronym language: #1}{}%
+ }}}}%
+}%
+
+% ===========================================================================
+% =================== PUBLIC ENVIRONMENTS ===================================
+% ===========================================================================
+
+% --------------- acronymlang -----------------------------------------------
+% environment similar to setacronymlang macro
+\newenvironment{acronymlang}[1]%
+{%
+ \let\glosmath@oldacrlang\glosmath@acrlang%
+ \setacronymlang{#1}%
+}{\expandafter\setacronymlang\expandafter{\glosmath@oldacrlang}}%
+
+% ===========================================================================
+% =================== GLOSSARIES STYLES =====================================
+% ===========================================================================
+
+% ---------- main language nomenclature style -------------------------------
+\newglossarystyle{nomencl}{\setglossarystyle{glosmath@glostyle}}%
+% ---------- main language style (synonym) ----------------------------------
+\newglossarystyle{nomencl-L1}{\setglossarystyle{glosmath@glostyle}}%
+% ---------- second language nomenclature style -----------------------------
+\newglossarystyle{nomencl-L2}{\setglossarystyle{glosmath@glostyle}%
+ \renewcommand*{\glosstyledesc}[1]{\glsentrydescsec{##1}}}%
+% ------ bilingual nomenclature style : descseclan (description) ------------
+\newglossarystyle{nomencl-L1L2}{\setglossarystyle{glosmath@glostyle}%
+ \renewcommand*{\glosstyledesc}[1]%
+ {\glsentrydesc{##1}\space(\textit{\glsentrydescsec{##1}})}}%
+% ------ bilingual nomenclature style : description (descseclan) ------------
+\newglossarystyle{nomencl-L2L1}{\setglossarystyle{glosmath@glostyle}%
+ \renewcommand*{\glosstyledesc}[1]%
+ {\glsentrydescsec{##1}\space(\textit{\glsentrydesc{##1}})}}%
+
+% ===========================================================================
+% =================== GLOSSARIES KEYS =======================================
+% ===========================================================================
+
+% ---------- second language description key -------------------------------
+\glsaddkey{descseclang}{% default value :
+ {\color{red}no second description at \texttt{descseclang}}%
+}{\glsentrydescsec}{\Glsentrydescsec}{\glsdescsec}{\Glsdescsec}{\GLSdescsec}%
+
+% ---------- dot accent key ------------------------------------------------
+\glsaddstoragekey*{dot}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.dot}}{}%
+ \ensuremath{\dot{\glsentrytext{\glslabel}}}%
+}{\glsentrydot}%
+% ---------- ddot accent key -----------------------------------------------
+\glsaddstoragekey*{ddot}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.ddot}}{}%
+ \ensuremath{\ddot{\glsentrytext{\glslabel}}}%
+}{\glsentryddot}%
+% ---------- bar accent key ------------------------------------------------
+\glsaddstoragekey*{bar}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.bar}}{}%
+ \ensuremath{\bar{\glsentrytext{\glslabel}}}%
+}{\glsentrybar}%
+% ---------- hat accent key ------------------------------------------------
+\glsaddstoragekey*{hat}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.hat}}{}%
+ \ensuremath{\widehat{\glsentrytext{\glslabel}}}%
+}{\glsentryhat}%
+% ---------- vec accent key ------------------------------------------------
+\glsaddstoragekey*{vec}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.vec}}{}%
+ \ensuremath{\vec{\glsentrytext{\glslabel}}}%
+}{\glsentryvec}%
+% ---------- tilde accent key ----------------------------------------------
+\glsaddstoragekey*{tilde}{% default value :
+ \nottoggle{glosmath@nodefop}{\glsadd{op.tilde}}{}%
+ \ensuremath{\widetilde{\glsentrytext{\glslabel}}}%
+}{\glsentrytilde}%
+
+% ===========================================================================
+% =================== PRIVATE STUFF =========================================
+% ===========================================================================
+
+% ---------- nomenclature base style ----------------------------------------
+\newcounter{glosmath@mainEntryCtr}%
+\newlength{\glosmath@curNameLen}%
+\newcommand*{\glosstyledesc}[1]{}%
+\newglossarystyle{glosmath@glostyle}%
+{%
+ \setglossarystyle{alttree}% based on alttree style
+ \renewenvironment{theglossary}%
+ {%
+ \let\glosmath@oldparskip\parskip%
+ \setlength{\parskip}{0pt}%
+ \let\glosmath@oldparindent\parindent%
+ \setlength{\parindent}{0pt}%
+ }%
+ {%
+ \setlength{\parskip}{\glosmath@oldparskip}%
+ \setlength{\parindent}{\glosmath@oldparindent}%
+ }%
+ \renewcommand*{\glossaryheader}%
+ {%
+ \iftoggle{glosmath@singlelineskip}{%
+ \ifdefined\SingleSpacing\SingleSpacing\fi% memoir class
+ \ifdefined\singlespacing\singlespacing\fi% setspace package
+ }{}%
+ }%
+ \setcounter{glosmath@mainEntryCtr}{0}%
+ \setlength{\glosmath@curNameLen}{\glstreeindent}%
+ % desc in all languages of the style (default to main language only) :
+ \renewcommand*{\glosstyledesc}[1]{\glsentrydesc{##1}}%
+ \renewcommand*{\glossentry}[2]%
+ {%
+ \ifnum\value{glosmath@mainEntryCtr}>0\leavevmode\par\fi%
+ \glstarget{##1}{\glscatnamefmt{\glosstyledesc{##1}}}%
+ \par\nopagebreak%
+ \stepcounter{glosmath@mainEntryCtr}%
+ }%
+ \renewcommand*{\subglossentry}[3]%
+ {%
+ \settowidth{\glstreeindent}{\@glswidestname\glstreepredesc}%
+ \hangindent\glstreeindent%
+ \settowidth{\glosmath@curNameLen}{\glossentryname{##2}\glstreepredesc}%
+ % larger namebox for entries longer than @glswidestname :
+ \ifdimgreater{\glosmath@curNameLen}{\glstreeindent}{%
+ \setlength{\glstreeindent}{\glosmath@curNameLen}}{}%
+ \glstreenamebox{\glstreeindent}{%
+ \glstarget{##2}{\glossentryname{##2}}%
+ }%
+ \glosstyledesc{##2}%
+ \ifglshassymbol{##2}{,\space\glossentrysymbol{##2}}{}%
+ \par%
+ }%
+}%
+
+% ---------- accronyms base style ----------------------------------------
+\newcommand*{\glosmath@acrlang}{}%
+\newcommand*{\glosmath@acrmain}[1]{}%
+\newcommand*{\glosmath@Acrmain}[1]{}%
+\newcommand*{\glosmath@acrmainpl}[1]{}%
+\newcommand*{\glosmath@Acrmainpl}[1]{}%
+\newcommand*{\glosmath@acrpar}[1]{}%
+\newcommand*{\glosmath@Acrpar}[1]{}%
+\newcommand*{\glosmath@acrparpl}[1]{}%
+\newcommand*{\glosmath@Acrparpl}[1]{}%
+\newacronymstyle{glosmath@acrstyle}%
+{\GlsUseAcrEntryDispStyle{long-short}}% based on long-short disp style
+{%
+ % --- my custom macros for styles -------
+ \glosmath@setLone% default to main language
+ % --- glossaries standard macro redefinitions ---
+ % Singular, no case change:
+ \renewcommand*{\genacrfullformat}[2]{%
+ \glosmath@acrmain{##1}##2\space(\glosmath@acrpar{##1})%
+ }%
+ % Singular, first letter upper case:
+ \renewcommand*{\Genacrfullformat}[2]{%
+ \glosmath@Acrmain{##1}##2\space(\glosmath@Acrpar{##1})%
+ }%
+ % Plural, no case change:
+ \renewcommand*{\genplacrfullformat}[2]{%
+ \glosmath@acrmainpl{##1}##2\space(\glosmath@acrparpl{##1})%
+ }%
+ % Plural, first letter upper case:
+ \renewcommand*{\Genplacrfullformat}[2]{%
+ \glosmath@Acrmainpl{##1}##2\space(\glosmath@Acrparpl{##1})%
+ }%
+}%
+
+% ---------- glosmath@getMyGlsMacro -----------------------------------------
+\newcommand*{\glosmath@getMyGlsMacro}[1]%
+{%
+ \let\glosmath@MyGlsMacro\glsentrytext%
+ \notblank{#1}%
+ {%
+ \ifstrequal{#1}{dot}{\let\glosmath@MyGlsMacro\glsentrydot}%
+ {%
+ \ifstrequal{#1}{ddot}{\let\glosmath@MyGlsMacro\glsentryddot}%
+ {%
+ \ifstrequal{#1}{bar}{\let\glosmath@MyGlsMacro\glsentrybar}%
+ {%
+ \ifstrequal{#1}{hat}{\let\glosmath@MyGlsMacro\glsentryhat}%
+ {%
+ \ifstrequal{#1}{vec}{\let\glosmath@MyGlsMacro\glsentryvec}%
+ {%
+ \ifstrequal{#1}{tilde}{\let\glosmath@MyGlsMacro\glsentrytilde}%
+ {%
+ \PackageError{glosmathtools}{Unknown accent: #1}{}%
+ }}}}}}%
+ }{}%
+}%
+
+% ---------- glosmath@glsviRelay ------------------------------------------
+% relay macro for two optional aguments in the glsvi macro
+\newcommand*{\glosmath@glsviRelay}[3][]%
+{%
+ \expandafter\glosmath@getMyGlsMacro\expandafter{\glosmath@ArgI}%
+ \let \glosmath@FirGls \glosmath@MyGlsMacro%
+ \glosmath@getMyGlsMacro{#1}%
+ \let \glosmath@SecGls \glosmath@MyGlsMacro%
+ \ensuremath{%
+ \glsdisp{#2}{%
+ \glosmath@FirGls{#2}_{\glsdisp{#3}{\glosmath@SecGls{#3}}}%
+ }%
+ }%
+}%
+
+% ---------- glosmath@setLone --------------------------------------------
+\newcommand*{\glosmath@setLone}%
+{%
+ \renewcommand*{\glosmath@acrmain}[1]{\glsentrylong{##1}}%
+ \renewcommand*{\glosmath@Acrmain}[1]{\Glsentrylong{##1}}%
+ \renewcommand*{\glosmath@acrmainpl}[1]{\glsentrylongpl{##1}}%
+ \renewcommand*{\glosmath@Acrmainpl}[1]{\Glsentrylongpl{##1}}%
+ \renewcommand*{\glosmath@acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}}%
+ \renewcommand*{\glosmath@Acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}}%
+ \renewcommand*{\glosmath@acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}}%
+ \renewcommand*{\glosmath@Acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}}%
+ \renewcommand*{\glosmath@acrlang}{L1}%
+}%
+
+% ---------- glosmath@setLtwo --------------------------------------------
+\newcommand*{\glosmath@setLtwo}%
+{%
+ \glosmath@setLone % base defintions
+ \renewcommand*{\glosmath@acrmain}[1]{\glsentrydescsec{##1}}%
+ \renewcommand*{\glosmath@Acrmain}[1]{\Glsentrydescsec{##1}}%
+ \renewcommand*{\glosmath@acrmainpl}[1]{\glsentrydescsec{##1}}%
+ \renewcommand*{\glosmath@Acrmainpl}[1]{\Glsentrydescsec{##1}}%
+ \renewcommand*{\glosmath@acrlang}{L2}%
+}%
+
+% ---------- glosmath@setLoneLtwo ---------------------------------------
+\newcommand*{\glosmath@setLoneLtwo}%
+{%
+ \glosmath@setLone % base defintions
+ \renewcommand*{\glosmath@acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}%
+ ,\space\textit{\glsentrydescsec{##1}}}%
+ \renewcommand*{\glosmath@Acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}%
+ ,\space\textit{\Glsentrydescsec{##1}}}%
+ \renewcommand*{\glosmath@acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}%
+ ,\space\textit{\glsentrydescsec{##1}}}%
+ \renewcommand*{\glosmath@Acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}%
+ ,\space\textit{\Glsentrydescsec{##1}}}%
+ \renewcommand*{\glosmath@acrlang}{L1L2}%
+}%
+
+% ---------- glosmath@setLtwoLone ----------------------------------------
+\newcommand*{\glosmath@setLtwoLone}%
+{%
+ \glosmath@setLtwo % base defintions
+ \renewcommand*{\glosmath@acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}%
+ ,\space\textit{\glsentrydesc{##1}}}%
+ \renewcommand*{\glosmath@Acrpar}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}%
+ ,\space\textit{\Glsentrydesc{##1}}}%
+ \renewcommand*{\glosmath@acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshort{##1}}%
+ ,\space\textit{\glsentrydescpl{##1}}}%
+ \renewcommand*{\glosmath@Acrparpl}[1]%
+ {\protect\firstacronymfont{\glsentryshortpl{##1}}%
+ ,\space\textit{\Glsentrydescpl{##1}}}%
+ \renewcommand*{\glosmath@acrlang}{L2L1}%
+}%
+
+% ===========================================================================
+% =================== FINAL CODE EXECUTION ==================================
+% ===========================================================================
+
+\setglossarystyle{glosmath@glostyle}% default to main language only
+\setacronymstyle{glosmath@acrstyle}% default to main language only
+
+\endinput% \ No newline at end of file
diff --git a/macros/latex/contrib/glosmathtools/sample_glosmathtools.pdf b/macros/latex/contrib/glosmathtools/sample_glosmathtools.pdf
new file mode 100644
index 0000000000..6e48a5476a
--- /dev/null
+++ b/macros/latex/contrib/glosmathtools/sample_glosmathtools.pdf
Binary files differ
diff --git a/macros/latex/contrib/glosmathtools/sample_glosmathtools.tex b/macros/latex/contrib/glosmathtools/sample_glosmathtools.tex
new file mode 100644
index 0000000000..ae1aa12a5d
--- /dev/null
+++ b/macros/latex/contrib/glosmathtools/sample_glosmathtools.tex
@@ -0,0 +1,111 @@
+% !TeX encoding = UTF-8
+% !TeX spellcheck = fr_CA
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Document principal pour l'exemple d'utilisation de glosmathtools
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% nohyperref pour charger le package hyperref manuellement
+% voir https://gitlab.com/vigou3/ulthese/issues/2
+\documentclass[projet,nohyperref,english,french]{ulthese}
+%% ===================== packages ============================================
+\ifxetex\else \usepackage[utf8]{inputenc} \fi
+\usepackage{mathtools,siunitx,amsmath,amsfonts}
+\usepackage{hyperref} % dernier package chargé sauf glosmathtools
+\usepackage[qtmarkupright,singlelineskip]{glosmathtools}
+%% ===================== preamble ============================================
+%% ------------- glosmathtools -----------------------------------------------
+\makeglossaries% executé en premier
+\setacronymlang{L2}% abbréviation en langue seconde
+\setglossarystyle{nomencl-L2L1}% description bilingue
+\loadglsentries{sample_glosmathtools_glos} % fichier des définitions
+\glssetwidest{LOOP} % IMPORTANT : entrée la plus large de la nomenclature
+\renewcommand*{\glscatnamefmt}[1]{\textbf{#1}} % format des catégories
+%% ------------- ulthese ----------------------------------------------------
+\titre{Documentation et exemple de \texttt{glosmathtools} dans \texttt{ulthese}}
+\soustitre{v0.5.1}
+\auteur{Francis Gagnon}
+%% ============================================================================
+
+\begin{document}
+\frontmatter
+
+\frontispice
+\printglossary[title=Nomenclature]
+
+\mainmatter
+
+\chapter{Documentation et exemple de \texttt{glosmathtools}}
+
+\section{Compilation}
+Le package \texttt{glosmathtools} se base sur \texttt{glossaries} inclus dans MiKTeX et TeX Live. Un peu comme une bibliographie, la compilation du glossaire se fait en exécutant les commandes dans l'ordre suivant :
+\begin{enumerate}
+ \item \texttt{pdflatex}
+ \item \texttt{makeglossaries}
+ \item \texttt{pdflatex}
+\end{enumerate}
+La commande \texttt{makeglossaries} est directement accessible dans les menu de TeXstudio ou avec \texttt{F9}. Pour un autre éditeur, il faut ajouter une commande personnalisée. Par exemple, dans TexMaker, c’est accessible dans le menu \texttt{Utilisateur > Commandes Utilisateur > Éditer Commandes Utilisateur}:
+\begin{itemize}
+ \item Item menu : \texttt{glossaries}
+ \item Commande : \texttt{makeglossaries \%}
+\end{itemize}
+Sous Windows avec MiKTeX, il est possible que le script \texttt{makeglossaries} nécessite une installation de Perl (voir \url{https://tinyurl.com/ybnoyqjp}). Une fois Perl installé, il faut exécuter le script \texttt{perltex.exe} disponible dans le répertoire d'installation de MiKTeX.
+
+\section{Options du package}
+Les options du package \texttt{glosmathtools} se résument par :
+\begin{description}
+ \item[qtmarkupright] caractère \texttt{<">} raccourci pour indice sans italique
+ \item[singlelineskip] force interligne simple pour la nomenclature
+ \item[nodefop] utilisation des opérateurs et accents sans définition
+ \item[{[autres options]}] passés au package \texttt{glossaries}
+\end{description}
+De plus amples informations sont fournies ci-dessous.
+
+\section{Utilisation du package}
+\subsection{Symboles, indices et accentuations}
+
+L'insertion d'un symbole mathématique simple avec hyperlien se fait avec la macro \texttt{\textbackslash gls} de \texttt{glossaries} : \gls{k}, \gls{mat.A} et \gls{mat.b}. C'est la même chose pour les abréviations : le \gls{LOOP}. Les abréviations sont uniquement définies à leur première utilisation : le \gls{LOOP}.
+
+Les indices doivent être définis avec un label du format \texttt{sub.resteDuLabel}: l'indice \gls{sub.a} désigne l'air. La macro \texttt{\textbackslash glsub} permet d'ajouter un indice à une variable : \glsub{d}{v}, \glsub{z}{v}, \glsub{T}{v}, \glsub{D}{a}, \glsub{rho}{w} et \glsub{mu}{v}. En définissant les symboles mathématiques avec \texttt{\textbackslash newglosentrymath}, toutes les macros peuvent s'utiliser autant en mode \texttt{text} qu'en mode \texttt{math} (avec \texttt{\$\$}). Par contre, il est mieux d'écrire explicitement les symboles dans une équation afin d'alléger le code (pas d'hyperlien):
+\begin{equation}
+d"v + \glsub{d}{v} = \SI{10.0}{\centi\meter} = 3.937\qtmark
+\end{equation}
+Le package peut être chargé avec l'option \texttt{qtmarkupright}. Le caractère \texttt{<">} est alors configuré comme raccourci pour l'écriture d'un indice sans italique en mode \texttt{math} (\texttt{<\_>} pour indice italique) \footnote{ La macro \texttt{\textbackslash qtmark} permet d'insérer le caractère \texttt{<">}. En ISO, les indices représentant l'abréviation d'un mot s'écrivent sans italique, et, celles représentant une variable, en italique.}.
+
+La macro \texttt{\textbackslash glsvi} permet d'ajouter une variable en indice à une autre variable : \glsvi{T}{k}. Il est aussi possible d'ajouter deux indices séparés par une virgule avec \texttt{\textbackslash glsubs} : \glsubs{D}{w}{a}. En l’occurrence, l'opérateur virgule est ajouté dans la nomenclature, qui doit donc être défini dans le glossaire sous le label \texttt{op.comma}.
+
+Il est aussi possible d'ajouter des accents sur les variables avec la macro \texttt{\textbackslash glsac} : \glsac[dot]{m} et \glsac[bar]{T}. À leur utilisation respective, un opérateur est ajouté dans la nomenclature. Ils doivent donc être définis à leur label respectif. Les accents disponibles sont:
+\begin{description}
+\item[dot] $\dot{\bullet}$ (défini au label \texttt{op.dot})
+\item[ddot] $\ddot{\bullet}$ (défini au label \texttt{op.ddot})
+\item[bar] $\bar{\bullet}$ (défini au label \texttt{op.bar})
+\item[hat] $\widehat{\bullet}$ (défini au label \texttt{op.hat})
+\item[vec] $\vec{\bullet}$ (défini au label \texttt{op.vec})
+\item[tilde] $\widetilde{\bullet}$ (défini au label \texttt{op.tilde})
+\end{description}
+De plus, un argument optionnel permet d'ajouter des accents à toutes les macros précédentes : \glsub[bar]{T}{v} et \glsubs[dot]{m}{v}{a}. Il y a deux arguments optionnels dans le cas de \texttt{\textbackslash glsvi} : \glsvi[dot]{m}{k}, \glsvi[][dot]{k}{m} et \glsvi[bar][dot]{T}{m}. Finalement, il est possible d'utiliser les accents sans définition dans la nomenclature avec l'option \texttt{nodefop}.
+
+\subsection{Langue, abréviations et nomenclature}
+
+S'il y a des changements de langues à travers le document, il faut changer de langue pour les acronymes. La clé \texttt{descseclang} doit être préalablement définie dans le glossaire. Par la suite, la macro \texttt{\textbackslash setacronymlang} permet de choisir 4 options de langue:
+\begin{description}
+ \item[L1] description langue principale (abréviations) : \setacronymlang{L1}\acrfull{ODE}
+ \item[L2] description langue seconde (abréviations) : \setacronymlang{L2}\acrfull{ODE}
+ \item[L1L2] description bilingue, langue principale (abréviations, \textit{langue seconde}) : \setacronymlang{L1L2}\acrfull{ODE}
+ \item[L2L1] description bilingue, langue seconde (abréviations, \textit{langue principale}) : \setacronymlang{L2L1}\acrfull{ODE}
+\end{description}
+\setacronymlang{L2}% retour à la langue du document
+L'environnement \texttt{acronymlang} fonctionne de manière similaire : \begin{acronymlang}{L2L1}\acrfull{ODE}\end{acronymlang}. La macro \texttt{\textbackslash glslang} affiche l'acronyme dans la langue spécifiée : \glslang[L2L1]{ODE}. Les secondes descriptions sont aussi accessibles avec \texttt{\textbackslash glsdescsec} : une \glsdescsec{ODE}.
+
+Pour la nomenclature (ou liste des symboles), il est important de définir la plus longue entrée avec \texttt{\textbackslash glssetwidest} au préambule.
+Comme les abréviations, il est possible de changer sa langue avec 4 options de style pour \texttt{\textbackslash setglossarystyle}:
+\begin{description}
+ \item[nomencl-L1] (ou \textbf{nomencl}) descriptions langue principale
+ \item[nomencl-L2] descriptions langue seconde
+ \item[nomencl-L1L2] descriptions bilingues, langue principale (\textit{langue seconde})
+ \item[nomencl-L2L1] descriptions bilingues, langue seconde (\textit{langue principale})
+\end{description}
+L'option \texttt{singlespaceglos} du package permet de forcer un interligne simple pour la nomenclature (nécessite \texttt{ulthese}/\texttt{memoir} ou le package \texttt{setspace}). La macro \texttt{\textbackslash glscatnamefmt} peut être redéfinie au préambule afin de modifier le style de l'en-tête des catégories. L'exemple de la page ii est une nomenclature bilingue \textbf{nomencl-L2L1} en interligne simple.
+
+Si défini, le contenu de la clé \texttt{symbol} est ajouté a la fin de la description (pour les unités ou dimensions). À noter que les symboles mathématiques ne sont pas enregistrés dans cette clé, mais bien dans la clé \texttt{name}.
+
+\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/glosmathtools/sample_glosmathtools_glos.tex b/macros/latex/contrib/glosmathtools/sample_glosmathtools_glos.tex
new file mode 100644
index 0000000000..edab2bc8f9
--- /dev/null
+++ b/macros/latex/contrib/glosmathtools/sample_glosmathtools_glos.tex
@@ -0,0 +1,162 @@
+% !TeX encoding = UTF-8
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Glossary entry definitions
+%% - symbol : units or dimension (for matrices)
+%% - descseclang : second language description for bilangual nomennclature
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% ==================================================================
+% ======================= MATH SYMBOLS =============================
+% ==================================================================
+
+% ----------------------- LATIN SYMBOLS ----------------------------
+\newglossaryentry{latin}{name={latin},
+ description={Latin symbols},descseclang={Symboles latins},sort=1}
+{%
+ \newglosentrymath{k}{k}{
+ description={discrete time},
+ descseclang={temps discret},
+ sort=k,
+ parent=latin,
+ }
+ \newglosentrymath{T}{T}{
+ description={temperature},
+ symbol=\si{\kelvin},
+ descseclang={température},
+ sort=T,
+ parent=latin,
+ }
+ \newglosentrymath{z}{z}{
+ description={height},
+ symbol=\si{\meter},
+ descseclang={hauteur},
+ sort=z,
+ parent=latin,
+ }
+ \newglosentrymath{d}{d}{
+ description={diameter},
+ symbol=\si{\meter},
+ descseclang={diamètre},
+ sort=d,
+ parent=latin,
+ }
+ \newglosentrymath{D}{D}{
+ description={molecular diffusion coefficient},
+ symbol=\si{\meter\squared\per\second},
+ descseclang={coefficient de diffusion moléculaire},
+ sort=D,
+ parent=latin,
+ }
+ \newglosentrymath{m}{m}{
+ description={mass},
+ symbol=\si{\kilogram},
+ descseclang={masse},
+ sort=m,
+ parent=latin,
+ }
+}%
+
+% ---------------------- GREEK SYMBOLS -----------------------------
+\newglossaryentry{greek}{name={greek},
+ description={Greek symbols},descseclang={Symboles grecs},sort=2}
+{%
+ \newglosentrymath{rho}{\rho}{
+ description={density},
+ symbol=\si{\kilogram\per\meter\cubed},
+ descseclang={masse volumique},
+ sort=17, % rho : 17th letter in greek alphabet
+ parent=greek,
+ }
+ \newglosentrymath{mu}{\mu}{
+ description={dynamic viscosity},
+ symbol=\si{\kilogram\per\meter\per\second},
+ descseclang={viscosité dynamique},
+ sort=12, % mu : 12th letter in greek alphabet
+ parent=greek,
+ }
+}%
+
+
+% ---------------------- VECTORS AND MATRICES ----------------------
+\newglossaryentry{vecMat}{name={vecMat},
+ description={Vectors and matrices},descseclang={Vecteurs et matrices},sort=3}
+{%
+ \newglosentrymath{mat.b}{\mathbf{b}}{
+ description={vector},
+ symbol=$(2 \times 1)$,
+ descseclang={vecteur},
+ sort=b,
+ parent=vecMat,
+ }
+ \newglosentrymath{mat.A}{\mathbf{A}}{
+ description={matrix},
+ symbol=$(2 \times 2)$,
+ descseclang={matrice},
+ sort=A,
+ parent=vecMat,
+ }
+}%
+
+% ---------------------- SUBSCRIPTS --------------------------------
+\newglossaryentry{subscript}{name={subscript},
+ description={Subscripts},descseclang={Indices},sort=4}
+{%
+ \newglosentrymath{sub.w}{\mathrm{w}}{
+ description={water},
+ descseclang={eau},
+ parent=subscript
+ }
+ \newglosentrymath{sub.a}{\mathrm{a}}{
+ description={air},
+ descseclang={air},
+ parent=subscript
+ }
+ \newglosentrymath{sub.v}{\mathrm{v}}{
+ description={vessel},
+ descseclang={réservoir},
+ parent=subscript
+ }
+}%
+
+
+% ---------------------- OPERATORS --------------------------------
+\newglossaryentry{operator}{name={operator},
+ description={Operators},descseclang={Opérateurs},sort=5}
+{%
+ \newglosentrymath{op.dot}{\dot{\bullet}}{
+ description={flow rate of $\bullet$},
+ descseclang={débit de $\bullet$},
+ symbol=\si{\per\second},
+ sort=01,
+ parent=operator
+ }
+ \newglosentrymath{op.bar}{\bar{\bullet}}{
+ description={average of $\bullet$},
+ descseclang={moyenne de $\bullet$},
+ sort=02,
+ parent=operator
+ }
+ \newglosentrymath{op.comma}{\bullet,\!\circ}{
+ description={in subscript : from $\bullet$ to $\circ$},
+ descseclang={en indice : de $\bullet$ vers $\circ$},
+ sort=03,
+ parent=operator
+ }
+}%
+
+% ==================================================================
+% ========================= ACRONYMS ===============================
+% ==================================================================
+
+\newglossaryentry{abbrv}{name={abbrv},
+ description={Abbreviations},descseclang={Abréviations},sort=6}
+{%
+ \newacronym[%
+ descseclang={équation différentielle ordinaire},%
+ parent=abbrv%
+ ]{ODE}{ODE}{ordinary differential equation}
+ \newacronym[%
+ descseclang={laboratoire d'observation et d'optimisation des procédés},%
+ parent=abbrv%
+ ]{LOOP}{LOOP}{process observation and optimization laboratory}
+}% \ No newline at end of file