Error with babel and AMC

Added by Adin Ramirez over 9 years ago

I just get a weird error while using open questions and babel with spanish language.

See the example attached. The error I got is:

@! Extra \endcsname.
\language@active@arg~ ...@~@\string #1@\endcsname 
                                                  \fi 
l.28 }

I'm ignoring this, since I wasn't doing a \csname.
! Extra \endcsname.
\language@active@arg~ ...@~@\string #1@\endcsname 
                                                  \fi 
l.28 }@

And in the resulting document I obtained an "@" at the end of each line of the open question.

amc-babel.tex (537 Bytes)

amc-babel.pdf (86.8 kB)


Replies (2)

RE: Error with babel and AMC - Added by Alexis Bienvenüe over 9 years ago

It seems that the character ~ is made active by spanish babel, and this disturbs AMC.
You can replace ~ with \hspace*{0pt} in lines 1304, 1306 and maybe 1321 (these are lines in my version of AMC, perhaps different for your version) from automultiplechoice.sty (inside definition of \AMCopen@lines).
Or you can copy /usr/share/texmf/tex/latex/AMC/automultiplechoice.sty to your project directory, and make the correction on this file.
I will correct this in the development version of AMC: thanks for posting about this issue.

RE: Error with babel and AMC - Added by Adin Ramirez over 9 years ago

Thanks, that did the trick.

Instead of changing the source one can patch it using etoolbox package (so you don't break it when you update the AMC).

In case someone is interested on the solution:

\patchcmd{\AMCopen@lines}{~}
{\hspace*{0pt}}
{}{}

and include \usepackage{etoolbox}

(1-2/2)