I am using the glossaries
package with the acronym
option to display multiple lists of acronyms and symbols. Using \glsresetall
makes the next use of any acronym appear with the full description but this does not happen for the symbols. I can not use the acronym format for the other glossaries as they include values and units.
How can I make the first use of a glossary give the full format, as the first use of an acronym does?
MWE:
\documentclass{report}
\usepackage{siunitx}
\usepackage[nomain, acronym, section=section]{glossaries} % use glossaries-package
\setlength{\glsdescwidth}{15cm}
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolslist} % create add. symbolslist
\glsaddkey{symbolvalue}{\glsentrytext{\glslabel}}{\glsentrysymbolvalue}{\GLsentrysymbolvalue}{\glssymbolvalue}{\Glssymbolvalue}{\GLSsymbolvalue}
\glssetnoexpandfield{symbolvalue}
\glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit}
\glssetnoexpandfield{unit}
\makeglossaries % activate glossaries-package
\newglossaryentry{lightspeed}{
name=\ensuremath{c},
description={speed of light},
symbolvalue={299792432},
unit={\si{\meter/\second}},
type=symbolslist
}
\newacronym[longplural={Frames per Second}]{fps}{FPS}{Frame per Second}
\newglossarystyle{mylist}{%
% put the glossary in the itemize environment:
\renewenvironment{theglossary}{\setlength{\LTleft}{0pt}\begin{longtable}{l>{\raggedright}p{.4\textwidth}>{\raggedleft}p{0.3\textwidth}r}}{\end{longtable}}%
% have nothing after \begin{theglossary}:
\renewcommand*{\glossaryheader}{% Change the table header
Sign & Description & Value & Unit \\
\endhead}
% have nothing between glossary groups:
\renewcommand*{\glsgroupheading}[1]{}%
\renewcommand*{\glsgroupskip}{}%
% set how each entry should appear:
\renewcommand*{\glossentry}[2]{% Change the displayed items
\glstarget{##1}{\glossentryname{##1}} %
& \glossentrydesc{##1}% Description
& \glssymbolvalue{##1}
& \glsunit{##1}%
\tabularnewline
}
}
\begin{document}
\glsaddall
\printglossary[type=symbolslist,style=mylist] % list of symbols
\printglossary[type=\acronymtype] % prints just the list of acronyms
\glsresetall
Now the first use of the acronym gives \gls{fps}
But the first use of the symbol gives \gls{lightspeed}, whereas I want it to give \glsdesc{lightspeed} (\glsname{lightspeed})
\end{document}
Result:
\glsfirst{<key>}
, which should come with a correspondingfirst={speed of light~($c$)}
field in your glossary entry. See tex.stackexchange.com/a/106557/117534\glsfirst{<key>}
, gives the same result as\gls{<key>}
, that is just c.first=...
field to yourlightspeed
glossary entry?