Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to use package amscd for a commutative diagram. Everything goes smoothly if I write:

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

However, if I replace english by spanish it doesn't work anymore. I get:

"Runaway argument?
b>> C\\ @VVV @VVV\\
 C @>>> R (V)
\end {CD}$
\end {document}
! File ended while scanning use of \ @>.
<inserted text> 
                \par 
<*> prueba1.tex

I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.

! Emergency stop.
<*> prueba1.tex

*** (job aborted, no legal \end found)"

Any hints on how to solve it without having to use the english option?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

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.

share|improve this answer
    
But then the characters remain active outside the CD environment and conflicts will appear, for example, using TikZ's -> construct. I think it's better to suppress the problem with < and > for all the document, either by using es-noshorthands or (less drastically) by using es-noquoting. –  Gonzalo Medina May 29 '11 at 22:47
    
@Gonzalo That's true. Probably TikZ should do something about that just like many other packages (which is not likely to happen with amscd). I don't know enough of Spanish typography to judge wether the < and > shorthand are really useful. I'll add something to my answer. –  egreg May 29 '11 at 22:57

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}
share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.