[Xy-pic] xylattice and babel

Ross Moore ross.moore at mq.edu.au
Mon Dec 20 01:21:47 CET 2010


Hi Olivier,

On 19/12/2010, at 1:28 AM, Olivier Debarre wrote:

> Hi,
> 
> Is there an incompatibility between xylattice and babel?
> When I typeset
> 
> \documentclass{article}
> \usepackage{graphics}
> \usepackage[all,ps,cmtip]{xy}
> \xyoption{web}
> %\usepackage[francais]{babel}
> \begin{document}
> $$
> \def\latticebody{
> \drop{.}\drop{.}}
> \xy *\xybox{0;<1pc,0mm>:<0mm,1pc>::
> ,0,{\xylattice{-5}{5}{-5}{5}}
> }="L"
> \endxy
> $$
> \end{document}
> 
> it does not work when I activate the line \usepackage[francais]{babel}
> 
> 
> Are you aware of that problem? Is there any way to fix it?

Yes.
The problem is due to the fact that Babe, with French,
activates so characters:  namely '?' ':' ';' and '!'
for special purposes with french spelling or punctuation.
These characters become macros, with expansions that can
be altered using \extrasfrench  or  \noextrasfrench .

However, this does not happen until the  \begin{document}
which is well after Xy-pic is loaded.
Thus Xy-pic cannot know that the nature of these characters
(technically, the category-codes) have changed --- which causes
the upset parsing that you encounter.


Here is a possible fix.

Define a macro as follows:

\def\xyunfrenchcatcodes{\catcode 33 12 \catcode 58 12 \catcode 59 12 \catcode 63 12 }

Now use it within the math-environment, before any
Xy-pic diagram.

  e.g.

$$
\xyunfrenchcatcodes
\def\latticebody{
\drop{.}\drop{.}}
\xy *\xybox{0;<1pc,0mm>:<0mm,1pc>::
,0,{\xylattice{-5}{5}{-5}{5}}
}="L"
\endxy
$$


The drawbacks to doing this are:

 1.  you need to use  \xyunfrenchcatcodes  with each
    diagram (or rather, environment containing a diagram)
    rather than have a single fix for all of them;

 2.  you cannot use the characters  !;;?
    for the intended french purpose, within any text
    that may occur within diagrams.

Maybe we need to revisit the parsing in Xy-pic, to
see whether this kind of character inconsistency can
be handled better.
 


> Thanks a lot,
> 
> 
> Olivier DEBARRE


Hope this helps,

	Ross

------------------------------------------------------------------------
Ross Moore                                       ross.moore at mq.edu.au 
Mathematics Department                           office: E7A-419      
Macquarie University                             tel: +61 (0)2 9850 8955
Sydney, Australia  2109                          fax: +61 (0)2 9850 8114
------------------------------------------------------------------------






More information about the xy-pic mailing list