Discussion:
Acronym package - ! Missing \endcsname inserted.
(too old to reply)
jel
2008-08-11 21:07:09 UTC
Permalink
I'm using the acronym package and LaTeX seems to not like the
following acronym definition:

\acro{M\&S}{Modeling and Simulation}

LaTeX displays the error:

! Missing \endcsname inserted.
<to be read again>
\&
l.125 ...ink{M\&S}{M\&S}]{Modeling and Simulation}

If I simply hit return to continue processing the final result seems
to look fine in my acronym list but I'm not sure if this will cause me
grief in other ways.

Is this a real problem? Easily fixed?
Patrick Drechsler
2008-08-11 21:44:30 UTC
Permalink
Post by jel
I'm using the acronym package and LaTeX seems to not like the
\acro{M\&S}{Modeling and Simulation}
! Missing \endcsname inserted.
[...]
Post by jel
Is this a real problem? Easily fixed?
Use a short and simple command without markup:

,----[ acronym.pdf Section 2.3 ]
| Because internal commands take acronym for storing the different
| forms of the acronym, the TEX code for the acronym is limited by
| \csname. If the acronym requires problematic or complicate TEX stuff
| (font commands, . . . ), then this code can be given in the optional
| argument short name . The first argument acronym is then a simpler
| string to identify the acronym. For example, an acronym for water can
| look like this:
| \acro{H2O}[$\mathrm{H_2O}$]{water}
| Then \acs{H2O} gets "H2 O" and \acl{H2O} prints "water".
`----

So, instead of:

\acro{M\&S}{Modeling and Simulation}

try:

\acro{MandS}[M\&S]{Modeling and Simulation}

Cheers,

Patrick
e***@gmail.com
2018-10-01 14:33:50 UTC
Permalink
Wow, great hack! Just tried it on my own problem and it works out perfectly. Thanks a lot!
David Kastrup
2008-08-11 21:45:35 UTC
Permalink
Post by jel
I'm using the acronym package and LaTeX seems to not like the
\acro{M\&S}{Modeling and Simulation}
! Missing \endcsname inserted.
<to be read again>
\&
l.125 ...ink{M\&S}{M\&S}]{Modeling and Simulation}
If I simply hit return to continue processing the final result seems
to look fine in my acronym list but I'm not sure if this will cause me
grief in other ways.
Is this a real problem? Easily fixed?
\acro{M&S}{Modeling and Simulation}...

I am not sure this will always do the right thing when used in tables,
however.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
UKTUG FAQ: <URL:http://www.tex.ac.uk/cgi-bin/texfaq2html>
Loading...