[XeTeX] XeLaTeX and SIunitx(in a way OT)

Keith J. Schultz keithjschultz at web.de
Mon May 14 09:47:02 CEST 2012

Thanx for the info.

I was just curious because of the discussions about backward/"legacy" compatibilties
with UTF.

It would seem to me that them all "base" packages should be refractured to 
the point where the package/style file contains the if(engine) and loads then
the appropriate files for them.

Yes, this approach does have the big draw back that there is more code to maintain,
yet it has the advantage the for older engines the code can be left alone and one
can concentrate on the modern technologies.


Am 14.05.2012 um 09:08 schrieb Bruno Le Floch:

>> In a style file would say TeX barf if it contained utf-8 characters even if
>> I have them in a conditional sothat the are not processed by the engine
>> just parsed?
> I believe that it would be ok if you use the actual bytes ^^c3 and
> ^^b5 in the file.
> The reason is that pdfTeX only makes (most) code points from 0 to 31
> invalid (?), and those only appear in the utf-8 encoding of the
> Unicode code points 0 to 31, which you are probably not using in your
> files (except 9, 10, 13, which are ok for pdfTeX).
> On the other hand, if you want to use the ^^ notation, for pdfTeX (set
> up with the appropriate inputenc option) you'd need to use the eight
> characters ^, ^, c, 3, ^, ^, b, and 5 (that'd give you à and µ in
> [Xe/Lua]TeX), whereas for the other two engines you'd need either ^^b5
> or ^^^^00b5.  In this last case of the ^^^^ notation, pdfTeX will
> choke even if it appears in the unused branch of a conditional.
> Now, why would anyone use the ^^ notation? Because it is most robust
> against encoding changes since we then only use ASCII characters.
> Using utf-8 encoded characters directly is only good if you stick with
> utf-8 (which I'd advise).
> So I'd say my impression is that the best is to use ^^^^xxxx, but in a
> separate file, loaded for the luatex or xetex engine.  Three other
> options:
> * Keep one file, work in a group, and use \catcode`\^^^=9 for the
> pdftex engine before any ^^^^xxxx appears.
> * Put the pdfTeX-specific commands first in the file, and
> conditionally \ifpdftex \endinput \fi, then anyhing can appear later
> in the file.
> * Use \char"00b5, which only works if your font is encoded in a
> sensible way IIRC.
> Hope that helps (and is correct),
> Bruno
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex

More information about the XeTeX mailing list