[tex-live] serious `slovak' Babel bug

Zdenek Wagner zdenek.wagner at gmail.com
Mon Jan 4 17:05:20 CET 2010

2010/1/4 Ulrike Fischer <news3 at nililand.de>:
> Am Mon, 04 Jan 2010 15:21:27 +0100 (CET) schrieb Werner LEMBERG:
>>>> It might be acceptable that the ^^xx notation fails within a
>>>> Slovakian language environment since the circumflex has been made a
>>>> shorthand, but this is not the case here.
>>> This is a general babel behaviour: the catcodes of the various
>>> shorthands are not reset at language switches.
>> Well, the `latin' language module shows how to handle it in a graceful
>> way.
> Not really. E.g in the following example latex simply hangs if I
> don't uncomment the \ProsodicMarksOff:
It is caused by the way how babel handles shorthands. Within
\AtBeginDocument tha \catcode is set to 13 but it expands to the same
character with the original catcode. If you switch the feature for
which you need the character (some \languageattribute etc), the
defiition of the active character is changed accordingly.

Now assume you have $a^2$. If the feature is not activated, TeX sees ^
with category 13 which is expanded to ^ with category 7, so everything
works. If the feature is active, the expansion includes \ifmmode so
that in math we get again ^ with category 7. The case of ^^78 is more
difficult. TeX mouth is looking for two identical characters with
category 7 followed by two hex digits. However, the category of ^ is
now 13 so that they go to the TeX stomach. If the feature is inactive,
TeX will find ^ with category 7 out of math, if it is active,
something unexpected happens. The definition should be able to find
the next character and two hex digits and emulate TeX mouth inside TeX

> \documentclass{article}
> \usepackage[latin,english]{babel}
> \languageattribute{latin}{withprosodicmarks}
> \begin{document}
> \selectlanguage{latin}
> \ProsodicMarksOn ^ia
> \selectlanguage{english}
> %\ProsodicMarksOff
> abc ^^74
> \end{document}
> --
> Ulrike Fischer

Zdeněk Wagner

More information about the tex-live mailing list