summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/glosmathtools/glosmathtools.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-21 03:01:37 +0000
committerNorbert Preining <norbert@preining.info>2020-03-21 03:01:37 +0000
commit3e43bc594a14e8c4fc21d6a71f22a23dd78fe252 (patch)
tree19d1a8bb88da795b5317f91775f645e0b7bd9eb9 /macros/latex/contrib/glosmathtools/glosmathtools.sty
parentc720a4409b388fa706f3eb1ce275f76f7d49d996 (diff)
CTAN sync 202003210301
Diffstat (limited to 'macros/latex/contrib/glosmathtools/glosmathtools.sty')
-rw-r--r--macros/latex/contrib/glosmathtools/glosmathtools.sty51
1 files changed, 39 insertions, 12 deletions
diff --git a/macros/latex/contrib/glosmathtools/glosmathtools.sty b/macros/latex/contrib/glosmathtools/glosmathtools.sty
index c117579d29..1eeab40e75 100644
--- a/macros/latex/contrib/glosmathtools/glosmathtools.sty
+++ b/macros/latex/contrib/glosmathtools/glosmathtools.sty
@@ -3,7 +3,7 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{glosmathtools}%
[%
-2019/08/02 v0.5.1 %
+2020/03/20 v0.5.2 %
Mathematical nomenclature tools based on glossaries package %
Francis Gagnon %
]%
@@ -74,16 +74,6 @@ Francis Gagnon %
\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
@@ -109,6 +99,26 @@ Francis Gagnon %
}%
}%
+% ---------- 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%
+}%
+
+% ---------- glsvisub ----------------------------------------------------
+% show $a_{b_c}$ with link to "a", variable "b" and subscript "sub.c"
+% 4 arguments : 3 mandatory arguments and optional 1st and 2nd argument
+% for adding accent on "a" and "b"
+\newcommand*{\glsvisub}[1][]%
+{%
+ \def\glosmath@ArgI{#1}%
+ \glosmath@glsvisubRelay%
+}%s
+
% ---------- glslang -----------------------------------------------------
% show full accronyms definition in specified languages
\newcommand*{\glslang}[2][]%
@@ -331,7 +341,24 @@ Francis Gagnon %
\let \glosmath@SecGls \glosmath@MyGlsMacro%
\ensuremath{%
\glsdisp{#2}{%
- \glosmath@FirGls{#2}_{\glsdisp{#3}{\glosmath@SecGls{#3}}}%
+ \glosmath@FirGls{#2}_{%
+ \glsdisp{#3}{\glosmath@SecGls{#3}}}%
+ }%
+ }%
+}%
+
+% ---------- glosmath@glsvisubRelay ---------------------------------------
+% relay macro for two optional aguments in the glsvisub macro
+\newcommand*{\glosmath@glsvisubRelay}[4][]%
+{%
+ \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}_{\gls{sub.#4}}}}%
}%
}%
}%