texlive[51797] Master: glosmathtools (1aug19)

commits+karl at tug.org commits+karl at tug.org
Thu Aug 1 23:18:51 CEST 2019


Revision: 51797
          http://tug.org/svn/texlive?view=revision&revision=51797
Author:   karl
Date:     2019-08-01 23:18:51 +0200 (Thu, 01 Aug 2019)
Log Message:
-----------
glosmathtools (1aug19)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/glosmathtools/
    trunk/Master/texmf-dist/doc/latex/glosmathtools/README.md
    trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf
    trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.tex
    trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools_glos.tex
    trunk/Master/texmf-dist/tex/latex/glosmathtools/
    trunk/Master/texmf-dist/tex/latex/glosmathtools/glosmathtools.sty
    trunk/Master/tlpkg/tlpsrc/glosmathtools.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/glosmathtools/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/glosmathtools/README.md	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/glosmathtools/README.md	2019-08-01 21:18:51 UTC (rev 51797)
@@ -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 (2019-08-01)
+
+## Author
+
+Francis Gagnon <franckgaga2 at gmail.com>


Property changes on: trunk/Master/texmf-dist/doc/latex/glosmathtools/README.md
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf	2019-08-01 21:18:02 UTC (rev 51796)
+++ trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf	2019-08-01 21:18:51 UTC (rev 51797)

Property changes on: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.tex	2019-08-01 21:18:51 UTC (rev 51797)
@@ -0,0 +1,99 @@
+% !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}}
+\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{Symboles, indices et accentuations}
+
+L'insertion d'un symbole mathématique simple avec hyperlien se fait avec la macro \texttt{\textbackslash gls} de glossaries : \gls{k}, \gls{mat.A} et \gls{mat.b}. C'est la même chose pour les abréviations : le \Glspl{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}.
+
+\section{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{linespace}). 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


Property changes on: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools_glos.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools_glos.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools_glos.tex	2019-08-01 21:18:51 UTC (rev 51797)
@@ -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


Property changes on: trunk/Master/texmf-dist/doc/latex/glosmathtools/sample_glosmathtools_glos.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/glosmathtools/glosmathtools.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/glosmathtools/glosmathtools.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/glosmathtools/glosmathtools.sty	2019-08-01 21:18:51 UTC (rev 51797)
@@ -0,0 +1,404 @@
+% !TeX spellcheck = en_US
+% !TeX encoding = UTF-8
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{glosmathtools}%
+[%
+2019/08/01 v0.5 %
+Mathematical nomenclature tools based on glossaries package %
+Francis Gagnon %
+]%
+\RequirePackage{amsmath,amsfonts,etoolbox}%
+% noredefwarn to supress warnings with memoir class redifintion :
+\RequirePackage[noredefwarn]{glossaries}%
+
+% ===========================================================================
+% =================== 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/linespace package required) 
+\newtoggle{glosmath at singlelineskip}%
+\DeclareOption{singlelineskip}{\toggletrue{glosmath at singlelineskip}}%
+
+%% using opperators/accents without nomenclature definitions
+\newtoggle{glosmath at nodefop}%
+\DeclareOption{nodefop}{\toggletrue{glosmath at nodefop}}%
+
+%% unknown options
+\DeclareOption*{%
+	\PackageWarning{glosmathtools}{Unknown option '\CurrentOption'}%
+}%
+
+\ProcessOptions\relax%
+
+% ===========================================================================
+% =================== 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 at getMyGlsMacro{#1}%
+	\ensuremath{\glsdisp{#2}{\glosmath at 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 at ArgI{#1}%
+	\glosmath at 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 at getMyGlsMacro{#1}%
+	\ensuremath{\glsdisp{#2}{\glosmath at 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 at getMyGlsMacro{#1}%
+	\nottoggle{glosmath at nodefop}{\glsadd{op.comma}}{}%
+	\ensuremath{%
+		\glsdisp{#2}{%
+			\glosmath at MyGlsMacro{#2}_{\gls{sub.#3},\gls{sub.#4}}%
+		}%
+	}%
+}%
+
+% ---------- glslang -----------------------------------------------------
+% show full accronyms definition in specified languages
+\newcommand*{\glslang}[2][]%
+{%
+	\let\glosmath at oldacrlang\glosmath at acrlang%
+	\notblank{#1}{\setacronymlang{#1}}{}%
+	\gls{#2}%
+	\expandafter\setacronymlang\expandafter{\glosmath at oldacrlang}%
+}%
+
+% ---------- setacronymlang -----------------------------------------------
+% set accronym definition to specified language(s)
+\newcommand*{\setacronymlang}[1]%
+{%
+	\ifstrequal{#1}{L1}{\glosmath at setLone}%
+	{%
+	\ifstrequal{#1}{L2}{\glosmath at setLtwo}%
+	{%
+	\ifstrequal{#1}{L1L2}{\glosmath at setLoneLtwo}%
+	{%
+	\ifstrequal{#1}{L2L1}{\glosmath at setLtwoLone}%
+	{%
+		\PackageError{glosmathtools}{Unknown accronym language: #1}{}%
+	}}}}%
+}%
+
+% ===========================================================================
+% =================== PUBLIC ENVIRONMENTS ===================================
+% ===========================================================================
+
+% --------------- acronymlang -----------------------------------------------
+% environment similar to setacronymlang macro
+\newenvironment{acronymlang}[1]%
+{%
+	\let\glosmath at oldacrlang\glosmath at acrlang%
+	\setacronymlang{#1}%
+}{\expandafter\setacronymlang\expandafter{\glosmath at oldacrlang}}%
+
+% ===========================================================================
+% =================== GLOSSARIES STYLES =====================================
+% ===========================================================================
+
+% ---------- main language nomenclature style -------------------------------
+\newglossarystyle{nomencl}{\setglossarystyle{glosmath at glostyle}}%
+% ---------- main language style (synonym) ----------------------------------
+\newglossarystyle{nomencl-L1}{\setglossarystyle{glosmath at glostyle}}%
+% ---------- second language nomenclature style -----------------------------
+\newglossarystyle{nomencl-L2}{\setglossarystyle{glosmath at glostyle}%
+	\renewcommand*{\glosstyledesc}[1]{\glsentrydescsec{##1}}}%
+% ------ bilingual nomenclature style : descseclan (description) ------------
+\newglossarystyle{nomencl-L1L2}{\setglossarystyle{glosmath at glostyle}%
+	\renewcommand*{\glosstyledesc}[1]%
+		{\glsentrydesc{##1}\space(\textit{\glsentrydescsec{##1}})}}%
+% ------ bilingual nomenclature style : description (descseclan) ------------
+\newglossarystyle{nomencl-L2L1}{\setglossarystyle{glosmath at 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 at nodefop}{\glsadd{op.dot}}{}%
+	\ensuremath{\dot{\glsentrytext{\glslabel}}}%
+}{\glsentrydot}%
+% ---------- ddot accent key -----------------------------------------------
+\glsaddstoragekey*{ddot}{%  default value :
+	\nottoggle{glosmath at nodefop}{\glsadd{op.ddot}}{}%
+	\ensuremath{\ddot{\glsentrytext{\glslabel}}}%
+}{\glsentryddot}%
+% ---------- bar accent key ------------------------------------------------
+\glsaddstoragekey*{bar}{%  default value :
+	\nottoggle{glosmath at nodefop}{\glsadd{op.bar}}{}%
+	\ensuremath{\bar{\glsentrytext{\glslabel}}}%
+}{\glsentrybar}%
+% ---------- hat accent key ------------------------------------------------
+\glsaddstoragekey*{hat}{% default value :
+	\nottoggle{glosmath at nodefop}{\glsadd{op.hat}}{}%
+	\ensuremath{\widehat{\glsentrytext{\glslabel}}}%
+}{\glsentryhat}%
+% ---------- vec accent key ------------------------------------------------
+\glsaddstoragekey*{vec}{% default value :
+	\nottoggle{glosmath at nodefop}{\glsadd{op.vec}}{}%
+	\ensuremath{\vec{\glsentrytext{\glslabel}}}%
+}{\glsentryvec}%
+% ---------- tilde accent key ----------------------------------------------
+\glsaddstoragekey*{tilde}{% default value :
+	\nottoggle{glosmath at nodefop}{\glsadd{op.tilde}}{}%
+	\ensuremath{\widetilde{\glsentrytext{\glslabel}}}%
+}{\glsentrytilde}%
+
+% ===========================================================================
+% =================== PRIVATE STUFF =========================================
+% ===========================================================================
+
+% ---------- nomenclature base style ----------------------------------------
+\newcounter{glosmath at mainEntryCtr}% 
+\newlength{\glosmath at curNameLen}%	
+\newcommand*{\glosstyledesc}[1]{}%
+\newglossarystyle{glosmath at glostyle}%
+{%
+	\setglossarystyle{alttree}% based on alttree style
+	\renewenvironment{theglossary}%
+	{%
+		\let\glosmath at oldparskip\parskip%
+		\setlength{\parskip}{0pt}%
+		\let\glosmath at oldparindent\parindent%
+		\setlength{\parindent}{0pt}%
+	}%
+	{%
+		\setlength{\parskip}{\glosmath at oldparskip}%
+		\setlength{\parindent}{\glosmath at oldparindent}%
+	}%
+	\renewcommand*{\glossaryheader}%
+	{%
+		\iftoggle{glosmath at singlelineskip}{%
+			\ifdefined\SingleSpacing \SingleSpacing \fi% memoir class
+			\ifdefined\singlespacing \singlespacing \fi% setspace package
+		}{}%
+	}%
+	\setcounter{glosmath at mainEntryCtr}{0}%
+	\setlength{\glosmath at 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 at mainEntryCtr}>0\leavevmode\par\fi%
+		\glstarget{##1}{\glscatnamefmt{\glosstyledesc{##1}}}%
+		\par\nopagebreak%
+		\stepcounter{glosmath at mainEntryCtr}%
+	}%
+	\renewcommand*{\subglossentry}[3]%
+	{%
+		\settowidth{\glstreeindent}{\@glswidestname\glstreepredesc}%
+		\hangindent\glstreeindent%
+		\settowidth{\glosmath at curNameLen}{\glossentryname{##2}\glstreepredesc}%
+		% larger namebox for entries longer than @glswidestname :
+		\ifdimgreater{\glosmath at curNameLen}{\glstreeindent}{%
+			\setlength{\glstreeindent}{\glosmath at curNameLen}}{}%
+		\glstreenamebox{\glstreeindent}{%
+			\glstarget{##2}{\glossentryname{##2}}%
+		}%
+		\glosstyledesc{##2}%
+		\ifglshassymbol{##2}{,\space\glossentrysymbol{##2}}{}%
+		\par%
+	}%
+}%
+
+% ---------- accronyms base style ----------------------------------------
+\newcommand*{\glosmath at acrlang}{}%
+\newcommand*{\glosmath at acrmain}[1]{}%
+\newcommand*{\glosmath at Acrmain}[1]{}%
+\newcommand*{\glosmath at acrmainpl}[1]{}%
+\newcommand*{\glosmath at Acrmainpl}[1]{}%
+\newcommand*{\glosmath at acrpar}[1]{}%
+\newcommand*{\glosmath at Acrpar}[1]{}%
+\newcommand*{\glosmath at acrparpl}[1]{}%
+\newcommand*{\glosmath at Acrparpl}[1]{}%
+\newacronymstyle{glosmath at acrstyle}%
+{\GlsUseAcrEntryDispStyle{long-short}}% based on long-short disp style
+{%
+	% --- my custom macros for styles -------
+	\glosmath at setLone% default to main language
+	% --- glossaries standard macro redefinitions ---
+	% Singular, no case change:
+	\renewcommand*{\genacrfullformat}[2]{%
+		\glosmath at acrmain{##1}##2\space(\glosmath at acrpar{##1})%
+	}%
+	% Singular, first letter upper case:
+	\renewcommand*{\Genacrfullformat}[2]{%
+		\glosmath at Acrmain{##1}##2\space(\glosmath at Acrpar{##1})%
+	}%
+	% Plural, no case change:
+	\renewcommand*{\genplacrfullformat}[2]{%
+		\glosmath at acrmainpl{##1}##2\space(\glosmath at acrparpl{##1})%
+	}%
+	% Plural, first letter upper case:
+	\renewcommand*{\Genplacrfullformat}[2]{%
+		\glosmath at Acrmainpl{##1}##2\space(\glosmath at Acrparpl{##1})%
+	}%
+}%
+
+% ---------- glosmath at getMyGlsMacro -----------------------------------------
+\newcommand*{\glosmath at getMyGlsMacro}[1]%
+{%
+	\let\glosmath at MyGlsMacro\glsentrytext%
+	\notblank{#1}%
+	{%
+		\ifstrequal{#1}{dot}{\let\glosmath at MyGlsMacro\glsentrydot}%
+		{%
+		\ifstrequal{#1}{ddot}{\let\glosmath at MyGlsMacro\glsentryddot}%
+		{%
+		\ifstrequal{#1}{bar}{\let\glosmath at MyGlsMacro\glsentrybar}%
+		{%
+		\ifstrequal{#1}{hat}{\let\glosmath at MyGlsMacro\glsentryhat}%
+		{%
+		\ifstrequal{#1}{vec}{\let\glosmath at MyGlsMacro\glsentryvec}%
+		{%
+		\ifstrequal{#1}{tilde}{\let\glosmath at MyGlsMacro\glsentrytilde}%
+		{%
+			\PackageError{glosmathtools}{Unknown accent: #1}{}%
+		}}}}}}%	
+	}{}%
+}%
+
+% ---------- glosmath at glsviRelay ------------------------------------------
+% relay macro for two optional aguments in the glsvi macro
+\newcommand*{\glosmath at glsviRelay}[3][]%
+{%
+	\expandafter\glosmath at getMyGlsMacro\expandafter{\glosmath at ArgI}%
+	\let \glosmath at FirGls \glosmath at MyGlsMacro%
+	\glosmath at getMyGlsMacro{#1}%
+	\let \glosmath at SecGls \glosmath at MyGlsMacro%
+	\ensuremath{%
+		\glsdisp{#2}{%
+			\glosmath at FirGls{#2}_{\glsdisp{#3}{\glosmath at SecGls{#3}}}%
+		}%
+	}%
+}%
+
+% ---------- glosmath at setLone --------------------------------------------
+\newcommand*{\glosmath at setLone}%
+{%
+	\renewcommand*{\glosmath at acrmain}[1]{\glsentrylong{##1}}%
+	\renewcommand*{\glosmath at Acrmain}[1]{\Glsentrylong{##1}}%
+	\renewcommand*{\glosmath at acrmainpl}[1]{\glsentrylongpl{##1}}%
+	\renewcommand*{\glosmath at Acrmainpl}[1]{\Glsentrylongpl{##1}}%
+	\renewcommand*{\glosmath at acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}}%
+	\renewcommand*{\glosmath at Acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}}%
+	\renewcommand*{\glosmath at acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}}%
+	\renewcommand*{\glosmath at Acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}}%
+	\renewcommand*{\glosmath at acrlang}{L1}% 
+}%
+
+% ---------- glosmath at setLtwo --------------------------------------------
+\newcommand*{\glosmath at setLtwo}%
+{%
+	\glosmath at setLone % base defintions
+	\renewcommand*{\glosmath at acrmain}[1]{\glsentrydescsec{##1}}%
+	\renewcommand*{\glosmath at Acrmain}[1]{\Glsentrydescsec{##1}}%
+	\renewcommand*{\glosmath at acrmainpl}[1]{\glsentrydescsec{##1}}%
+	\renewcommand*{\glosmath at Acrmainpl}[1]{\Glsentrydescsec{##1}}%
+	\renewcommand*{\glosmath at acrlang}{L2}%
+}%
+
+% ---------- glosmath at setLoneLtwo ---------------------------------------
+\newcommand*{\glosmath at setLoneLtwo}%
+{%
+	\glosmath at setLone % base defintions
+	\renewcommand*{\glosmath at acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}%
+		,\space\textit{\glsentrydescsec{##1}}}%
+	\renewcommand*{\glosmath at Acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}%
+		,\space\textit{\Glsentrydescsec{##1}}}%
+	\renewcommand*{\glosmath at acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}%
+		,\space\textit{\glsentrydescsec{##1}}}%
+	\renewcommand*{\glosmath at Acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}%
+		,\space\textit{\Glsentrydescsec{##1}}}%
+	\renewcommand*{\glosmath at acrlang}{L1L2}%
+}%
+
+% ---------- glosmath at setLtwoLone ----------------------------------------
+\newcommand*{\glosmath at setLtwoLone}%
+{%
+	\glosmath at setLtwo % base defintions
+	\renewcommand*{\glosmath at acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}%
+		,\space\textit{\glsentrydesc{##1}}}%
+	\renewcommand*{\glosmath at Acrpar}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}%
+		,\space\textit{\Glsentrydesc{##1}}}%
+	\renewcommand*{\glosmath at acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshort{##1}}%
+		,\space\textit{\glsentrydescpl{##1}}}%
+	\renewcommand*{\glosmath at Acrparpl}[1]%
+	{\protect\firstacronymfont{\glsentryshortpl{##1}}%
+		,\space\textit{\Glsentrydescpl{##1}}}%
+	\renewcommand*{\glosmath at acrlang}{L2L1}%
+}%
+
+% ===========================================================================
+% =================== FINAL CODE EXECUTION ==================================
+% ===========================================================================
+
+\setglossarystyle{glosmath at glostyle}% default to main language only
+\setacronymstyle{glosmath at acrstyle}% default to main language only
+
+\endinput%
\ No newline at end of file


Property changes on: trunk/Master/texmf-dist/tex/latex/glosmathtools/glosmathtools.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-08-01 21:18:02 UTC (rev 51796)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-08-01 21:18:51 UTC (rev 51797)
@@ -320,7 +320,7 @@
     gfsporson gfssolomos
     ghab ghsystem gillcm gillius gincltex ginpenc
     gitfile-info gitinfo gitinfo2 gitlog gitver
-    globalvals gloss glossaries
+    globalvals glosmathtools gloss glossaries
     glossaries-danish glossaries-dutch
     glossaries-english glossaries-estonian glossaries-extra
     glossaries-finnish glossaries-french

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2019-08-01 21:18:02 UTC (rev 51796)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2019-08-01 21:18:51 UTC (rev 51797)
@@ -87,6 +87,7 @@
 depend gastex
 depend gene-logic
 depend ghsystem
+depend glosmathtools
 depend gotoh
 depend grundgesetze
 depend gu

Added: trunk/Master/tlpkg/tlpsrc/glosmathtools.tlpsrc
===================================================================


More information about the tex-live-commits mailing list