I am using glossaries for creating lists of acronyms and symbols. For the list of symbols including units, I use code from this answer by Christian Hupfer: glossaries: How to customize list of symbols with additional column for units?
However, I need to differ between bold and non-bold symbols (referring to tensors or scalars), which is apparently not possible with that code. I'm struggling with the code adjustment pretty much and I could not find any way to make that possible. Could somebody help me out, please? Thanks a lot!!
MWE:
\documentclass{book}
\usepackage{siunitx}
\usepackage[acronym,toc]{glossaries} % use glossaries-package
\setlength{\glsdescwidth}{15cm}
\newglossary[slg]{symbolslist}{syi}{syg}{Symbolslist} % create add. symbolslist
\glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit}
\makeglossaries % activate glossaries- package
% ==== EXEMPLARY ENTRY FOR SYMBOLS LIST =========================================
\newglossaryentry{sig}{name=\ensuremath{\sigma},
description={This is a non-bold stress scalar},
unit={\si{\mega\pascal}},
type=symbolslist}
\newglossaryentry{csig}{name=\ensuremath{\boldsymbol{\sigma}},
description={This is a bold Cauchy stress tensor},
unit={\si{\mega\pascal}},
type=symbolslist}
% ==== EXEMPLARY ENTRY FOR ACRONYMS LIST ========================================
\newacronym{frp}{FRP}{Fiber Reinforced Polymers}
\newglossarystyle{symbunitlong}{%
\setglossarystyle{long3col}% base this style on the list style
\renewenvironment{theglossary}{% Change the table type --> 3 columns
\begin{longtable}{lp{0.6\glsdescwidth}>{\centeringarraybackslash}p{2cm}}}%
{\end{longtable}}%
%
\renewcommand*{\glossaryheader}{% Change the table header
\bfseries Sign & \bfseries Description & \bfseries Unit \\
\hline
\endhead}
\renewcommand*{\glossentry}[2]{% Change the displayed items
\glstarget{##1}{\glossentryname{##1}} %
& \glossentrydesc{##1}% Description
& \glsunit{##1} \tabularnewline
}
}
\begin{document}
\glsaddall
\printglossary[type=\acronymtype,style=long] % list of acronyms
\printglossary[type=symbolslist,style=symbunitlong] % list of symbols
\end{document}

documentenvironment. (Unless you use\usepackage[docdef=restricted]{glossaries-extra}and have all the glossaries at the end of the document.) – Nicola Talbot May 24 '18 at 10:58\glsnoexpandfieldsby default? – Ulrike Fischer May 24 '18 at 13:33glossaries-extra+bib2glsmethod,\glsnoexpandfieldsis implemented by default. – Nicola Talbot May 24 '18 at 14:20