Problem with spanish babel package

The spanish option for babel makes some characters active to build shorthands; these shorthands will conflict with the standard use of the characters in a non-spanish document. To prevent this problem load babel in the following way:

\usepackage[spanish,es-noshorthands]{babel}

This will disable all shorthands; to disable only those characters conflicting with quoting, you can use

\usepackage[spanish,es-noquoting]{babel}

The problem is that the Spanish module of babel activates the characters < and > in order to provide shorthands for "multilevel" quoting.

If you don't need those shorthands, you can use the technique proposed by Gonzalo Medina (i.e., the option es-noquoting or the more drastic es-noshorthands). Otherwise the code

\usepackage{etoolbox}
\preto\CD{\deactivatequoting}

after loading amscd will do the same job, deactivating the characters just for the CD environment.

One should realize that if T1-encoded fonts are used, the combinations << and >> already form ligatures for « and » (without the need of activating them). The package csquotes may be used instead of the quoting environment provided by the Spanish module for babel.


The command \deactivatequoting would solve it as well, also you can activate it again afterwards.

\documentclass{article}
\usepackage[spanish]{babel}
\usepackage{amscd}
\begin{document}
\deactivatequoting
$\begin{CD}
 A     @>b>>   C\\\ 
 @VVV                         @VVV\\     C  @>>>              R (V)
 \end{CD}$
\activatequoting
\end{document}

diagram