[XeTeX] xyling.sty compatibility with Xelatex

Alan Munn amunn at msu.edu
Fri Jan 9 23:00:23 CET 2009


At 8:05 AM +1100 1/10/09, Ross Moore wrote:
>Hello Alan, Pavel, and others
>
>On 10/01/2009, at 12:57 AM, Alan Munn wrote:
>
>>  At 10:23 AM +0100 1/9/09, Pavel Stranak wrote:
>>>  Hello,
>>>
>>>  I am just typesetting a paper that draws trees using macros \B and \K
>>>  from xyling.sty.
>>>  It works fine in latex, but in xelatex I get errors while processing
>>>  xyling saying that the macros \B and \T are already defined. Then the
>>>  edges in a tree are not drawn (thats what \B and \K are for).
>>>
>>>  Renaming the macros in the xyling.sty and in the paper helps, but I
>>>  wonder whether there is a solution that would make xyling really
>>>  compatible with xelatex.
>>
>>  This IS the solution, unfortunately.  When two packages use the same
>>  command names, one of them has to change them.  xunicode.sty defines
>>  both \T and \B; either it changes or xyling changes.  Should it
>>  change its names or should xyling?  Who decides?
>>
>>  Perhaps since the commands in xunicode.sty are not intended as user
>>  commands, whereas those in xyling are,  they should be changed in
>>  xunicode.
>
>Well, I beg to differ in this assessment.
>The use of single character macro names within specialised
>packages is well-recognised to be poor programming practice.
>There is a large possibility of incompatibility with other
>packages where short-name macros are used for more fundamental
>purposes (such as accented letters in non-english languages,
>or some other special character).

[examples snipped]

>
>Thus the obvious implication is that if your package uses
>single-letter macro names for a vital purpose, conflicting
>with usage required for a particular language or phonetics,
>then it cannot be used in conjunction with "whole languages".
>That surely cannot be the intention of the package-writer.
>
>Lesson:  don't use single-letter macro-names in packages!

Thanks Ross, this is a better argument than mine (which wasn't really 
an argument to begin with.)

>Now  xunicode.sty  is rather special, as it is designed to
>be a replacement for the myriad of encoding files for different
>languages. It uses the single-letter macros for exactly the same
>purpose --- namely special characters, accents and diacritics.
>Thus there is no incompatibility introduced this way.
>
>
>>  I don't know if there's a set protocol for this sort of
>>  situation.
>
>I think my comments above state this (unwritten) protocol.

Maybe there should be an entry in the FAQ for class writers.  (Being 
an end user, this is not something that one necessarily thinks about 
a lot.)

>
>
>It just a pity that  xyling  was written using some
>single-letter macro names, giving preference to expediency
>of typing rather than compatibility with all languages.


Yes, that's exactly the problem.  I guess Pavel should contact the 
author of XY-ling to change things.

Alan

-- 
Alan Munn						amunn at msu.edu
Department of Linguistics
and Germanic, Slavic, Asian and African Languages		Tel. 
	517-355-7491
Michigan State University, East Lansing MI 48824 USA	Fax	517-432-2736


More information about the XeTeX mailing list