I'm struggling with glossaries
package for a while...
I would like to change the standard alignment in the link text of \gls
.
I've used example code from equation variables:
\documentclass{report}
\usepackage[colorlinks]{hyperref}
\usepackage{glossaries}
\makeglossaries
\newcommand{\mathgloss}[2]{
\newglossaryentry{#1}{name={#1},description={#2}}
\gls{#1} = #2
}
\begin{document}
Consider the equation
\begin{equation}
e = m * c^2
\end{equation}
in which\\
\mathgloss{e}{energy}\\
\mathgloss{m}{mass}\\
\mathgloss{c}{speed of light}
\printglossaries
\end{document}
..and got the results:
I would like to change the alignment of the all descriptions to be more like in a table. I tried putting the code in the regular table but it didn't work.
I also tried the code below, but the question is the same.
\documentclass{article}
\usepackage[nopostdot,nonumberlist]{glossaries}
\makeglossary
\newglossaryentry{aaaaaa}{name=aaaaaa,description={speed of light},symbol={km/s}}
\newglossaryentry{b}{name=b,description={mass},symbol={kg}}
\renewcommand{\glstextformat}[1]{\small{#1}}
\renewcommand*{\glsentryfmt}{%
\glsgenentryfmt
\ifglsused{\glslabel}{}{\space -\space \glsentrydesc{\glslabel}}{,\space \glsentrysymbol{\glslabel}}%}
\begin{document}
\gls{aaaaaa} \\
\gls{b}
\printglossaries
\end{document}
Do you have any suggestions how to do this ? Or maybe there is a different/better approach to have equation variables description below the equation and at the same time in the glossary ?