1

Hello fellows and folks!

I am having trouble when trying to put a redefined symbol: \newcommand{\MatrixVariable}[1]{\bm{\mathit{#1}}} in the list of symbols. Here is a screenshot of the error:

enter image description here

This is the actual code I'm using in the preamble, except the \documentclass{report} etc.

\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[symbols,nogroupskip,sort=none]{glossaries-extra}

\glsxtrnewsymbol[description={position}]{x}{\ensuremath{x}}
\glsxtrnewsymbol[description={velocity}]{v}{\ensuremath{v}}
\glsxtrnewsymbol[description={acceleration}]{a}{\ensuremath{a}}
\glsxtrnewsymbol[description={time}]{t}{\ensuremath{t}}
\glsxtrnewsymbol[description={force}]{F}{\ensuremath{F}}

\begin{document}
\tableofcontents
\printunsrtglossary[type=symbols,style=long]

\chapter{Sample}
Reference symbols: $\gls{x}$, $\gls{v}$, $\gls{a}$, $\gls{t}$,
$\gls{F}$.

\end{document}
1

Judging from your picture, I’d guess that you forgot to load the bm package and the “Undefined control sequence” message was referring to the unknown \bm command. (This is why you should prepare a minimal example which replicates your problem, not just a picture, because your code spinet complies fine.)

Try

\documentclass{report}

\usepackage[colorlinks]{hyperref}
\usepackage[symbols,nogroupskip,sort=none]{glossaries-extra}

\usepackage{bm}% Is this package missing in your source file?
\newcommand{\MatrixVariable}[1]{\bm{#1}}
\glsxtrnewsymbol[description={Rating Matrix}]{MatrixVariable{R}}{\ensuremath{\MatrixVariable{R}}}

\begin{document}
\tableofcontents
\printunsrtglossary[type=symbols,style=long]

\chapter{Sample}
Reference symbols: $\gls{MatrixVariable{R}}$

\end{document}

Note that I’ve removed the inner \mathit—this is not needed (in fact it switches to text italic in math mode)—using \bm{#1} suffices.

  • 1
    It did work! Thank you so much! One last question: can I put the list of symbols and abbreviations in the same page? And also, it prints "Symbols" instead of "List of Symbols" – NaveganTeX Jun 2 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.