# Conflict between stackengine and babel with spanish option

When pdfLaTeXing the MWE below I get a Missing \endcsname inserted error message. The compilation proceeds with no errors as soon as the babel package is not loaded with the spanish option (well, to be true, I've only tried with the english option, and it works alright). Any hints on how to solve this issue, or on a possible workaround, would be welcome.

Follows the MWE:

\documentclass{memoir}

\usepackage{stackengine}
\usepackage[spanish]{babel}

\begin{document}
\Shortstack[c]{A N E}
\end{document}


EDIT: I've just tried with the es-noquoting option and with the coupled commands \deactivatequoting-\activatequoting, as suggested in some posts about issues related to spanish babel, but to no avail. The problem remains the same.

• An update to stackengine has been submitted to CTAN, based on Ulrike's answer. It should propagate in the coming days. – Steven B. Segletes Jan 6 '14 at 13:27

stackengine uses the command \roman in a csname (which is simply not a good idea: \roman is for printing and not for the generation of command names) and this breaks as spanish redefines \@roman. As a workaround you can disable the redefinition but imho stackengine should be corrected.

\documentclass{memoir}
\usepackage{stackengine}
\makeatletter
\let\ori@roman\@roman
\usepackage[spanish,]{babel}
\let\@roman\ori@roman

\begin{document}
\Shortstack[c]{A N E}
\end{document}

• If \roman should not be used, does the same admonition apply to \romannumeral? Your answer is the first I've heard about this topic. Are there any other pointers to this topic? – Steven B. Segletes Jan 6 '14 at 12:59
• @{Ulrike Fischer, Steven B. Segletes}: That made it. I've resorted to using the es-lcroman option, though, which also solves the issue, as discussed on tex.stackexchange.com/questions/64687/…, and where further discussion can be found. – Marcos Jan 6 '14 at 13:03
• @StevenB.Segletes: \romannumeral is ok. And the same problem is with \arabic, e.g. here tex.stackexchange.com/a/32229/2388. But if you look a bit around you will find other similar discussion. – Ulrike Fischer Jan 6 '14 at 13:07