Code: Select all
\glossary{name=X,description=Y}
\glossary
?I know glossary is now obsolete but, since I have
\glossary
entries throughout the book, it would be time-consuming to upgrade to the glossaries package. Given that this is just a token-expansion issue, I hoped that perhaps some TeXpert might have an easy solution.Here are some details. To make a glossary entry, I use a private macro
\glos
:Code: Select all
\def\glos<#1:#2>{\parse{#1}%
\glossary{name=\name { \it \gram}, description=#2}}
\parse parses #1 into two parts A and B, and makes two gdefs:
\gdef\name{A}\gdef\gram{B}
\glossary
as above. Previously, this resulted in the name being defined as A { \it B}
but now it is the unexpanded \name { \it \gram}
.I tried using a token register but I don't understand these well and I couldn't get it to do what I wanted. I also tried some other things (
\expandafter
, etc.) but I couldn't get them to work either.I verified that \parse is still defining
\main
and \gram
correctly. Also the following macro which is very similar to \glos
works correctly:
Code: Select all
\def\indx<#1>{\parse{#1} \index{\name}}
So the problem is indeed just with
\glossary
expansion.My whole index-glossary system in the book is quirky but helps to minimize typing: a single macro call handles glossary and indexing (indicators say whether to call
\glos
and/or \indx
in each case). I can get everything to work if I eliminate the parsing macro, but I would then have to manually redo every index/glossary entry in the book, so I'd rather not do that. Also it seems like giving up, rather than getting LaTeX to do what I want it to do.Thanks for any help or suggestions you may have!