Document ClassesList of symbols problem

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
Toby
Posts: 2
Joined: Tue Aug 05, 2008 9:41 am

List of symbols problem

Post by Toby »

Hello guys!

I have a little problem to get a list of symbols. I found and uses the listofsymbols package, and it is working so far. But as soon as I use mathematical Symbols in the Symbol description it screws up. Here a little example:

Code: Select all

\documentclass[a4paper, oneside, 12pt]{book}

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage[draft]{listofsymbols}
   
\opensymdef
    \newsym[small e]{syme}{e}
    \newsym[$\mathcal{P}_S$ is the speaker period]{mcalP}{\mathcal{P}_S}
\closesymdef
    
\begin{document}
    \listofsymbols
    
    test: \syme
\end{document}


without the \mathcal use everything works fine. When I compile I get more or less an Undefined control sequence error, but if explicitly use mathmode it doesn't work either. Does anybody know the problem cause? Is it a problem with the mathmode?
I really spent alread a lot of time trying to fix this.

Any help would be highly appreciated.

Toby

P.S: I don't want to use the symbol in reality for describing its meaning, it is just an example ;).

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

List of symbols problem

Post by Stefan Kottwitz »

Hi Toby,

welcome to the board!
You could prevent the expansion if \mathcal by \noexpand, then it should be compilable:

Code: Select all

\newsym[$\noexpand\mathcal{P}_S$ is the speaker period]{mcalP}{\noexpand\mathcal{P}_S}
Stefan
LaTeX.org admin
Toby
Posts: 2
Joined: Tue Aug 05, 2008 9:41 am

Re: List of symbols problem

Post by Toby »

Hi Stefan,

thank you very much!

Greetz
Post Reply