3

The code below was run with different combos involving spanish or english, and the resulting command \Foo, interprets the input in a manner that seems spurious when spanish is loaded. What am I missing?

enter image description here

enter image description here

enter image description here

enter image description here

\documentclass{article}
\usepackage{xparse}
\usepackage[
english,
spanish,
%english
]{babel}

\ExplSyntaxOn
  \DeclareDocumentCommand \Foo
  {
    D<>{Hello}                  % #1
    m                           % #2
  }
  {
    #1, #2!
  }

\tl_new:N \LoadedLanguages
\makeatletter
\@ifpackagewith{babel}{english}
{
  \@ifpackagewith{babel}{spanish}
  {\tl_set:Nn\LoadedLanguages{english~\&~spanish}}
  {\tl_set:Nn\LoadedLanguages{english}}
}
{
  \@ifpackagewith{babel}{spanish}
  {\tl_set:Nn\LoadedLanguages{spanish}}
  {}
}

\makeatother

\ExplSyntaxOff
\begin{document}

Loaded: \LoadedLanguages;~selected:~\languagename.

\Foo<Jello>{ world } (Expected: Jello, World!)

\end{document}

1 Answer 1

3

spanish activates < and > to enter guillemets, or more exactly as a shorthand for the quoting environment. This ‘misfeature’ made some sense about 25 years ago. You can deactivate it with:

\usepackage[
english,
spanish.noquoting
]{babel}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .