I want to create a list of symbols for my work, where the symbols are often provided with an index. Now I do not want to create a new entry for each symbol and index. Is it possible with another parameter in the call \ gls {\label, {#1}} the index (#1) put to the desired location. If I have expressed myself too cryptic, may help the minimal example:
\documentclass{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{BetragVektor1}{name=\ensuremath{|\overline{u_1}|},description={Länge des Vektors}}
\newglossaryentry{BetragVektor2}{name=\ensuremath{|\overline{u_2}|},description={Länge des Vektors}}
\newglossaryentry{BetragVektor}{name=\ensuremath{|\overline{u_2}|},description={Länge des Vektors}}
\begin{document}
target:\\
The vector $|\overline{u_1}|$ is longer than the vector $|\overline{u_2}|$.
option1:\\
The vector \gls{BetragVektor1} is longer than the vector \gls{BetragVektor2}.
option2(gloosarie-documentation) :\\
\gls{BetragVektor}{1}
This option writes the 1 at the end - not behind u.
\end{document}
Thanks for all the advice and I hope, there is a solution.
Best Answer
Here's one possible solution that uses the final optional argument of commands like
\gls
:This produces:
However, you won't be able to use this optional argument for any of your other glossary entries.
Edit:
Sorry, I forget that you also need to prevent the expansion of the
first
key. Here's an updated version where I've switched off expansion using\glsnoexpandfields
: