4 >Synopsis: Troubles with 2-letters shorthands
5 >Arrival-Date: Sun Apr 18 16:11:00 CEST 2004
6 >Originator: Benjamin BAYART (bayartb@jmpl.fr.eu.org)
8 It was discovered while trying to use "ethiop" within a french
9 document. I got it down to loading order dependency when there are
10 2-letter shorthands: if I declare a shorthand for :: in a language A
11 and use another for : in a language B, the order in which you load the
12 languages changes the behaviour (the space after : is gobbled if you
13 load the A language first).
15 The exemple provided here is a minimal language definition file
16 (testl.ldf, in a filecontents environment) which declares :: as a
17 shorthand producing TESTL. If I load testl first, and then francais,
18 eveything is good. If I load it the other way, it's wrong.
20 I guess something about "declare the longest shorthand first", but I'm
21 not sure. I'm also not sure of the way to fix it...
24 Sample file which indicates the problem:
25 ========================================
28 \begin{filecontents}{testl.ldf}
29 \ProvidesFile{testl.ldf}[2004/04/18 v0.0 Test file]
31 \LdfInit{testl}{captionstestl}
32 \ifx\undefined\l@testl
33 \adddialect\l@testl0\fi
34 \def\testlhyphenmins{{1}{1}}
35 \def\datetestl{\def\today{DATE}}
36 \initiate@active@char{:}
37 \addto\extrastestl{\languageshorthands{testl}}
38 \addto\extrastestl{\bbl@activate{:}}
39 \addto\noextrastestl{\bbl@deactivate{:}}
40 \declare@shorthand{testl}{::}{TEST}
46 \documentclass{article}
49 \FORMAT{LaTeX2e<2003/12/01>}
50 \AUTHOR{Benjamin BAYART (bayartb@jmpl.fr.eu.org)}
53 \PACKAGE[testl,francais]{babel}
57 \setbox0=\vbox{#1}\showbox0}
59 \usepackage[T1]{fontenc}
60 \usepackage[testl,francais]{babel}
65 \selectlanguage{testl}
66 \testit{ :- aa:: aa} % :: should be replaced by TEST in the output
68 \selectlanguage{francais}
70 \testit{Essai: not ok.}% the : should be surrounded with proper spacing