LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version:
1.0 (Apple Message framework v919.2)
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Subject:
From:
Will Robertson <[log in to unmask]>
Date:
Thu, 15 May 2008 23:55:37 +0930
In-Reply-To:
Content-Type:
multipart/signed; boundary=Apple-Mail-20-626103635; micalg=sha1; protocol="application/pkcs7-signature"
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Parts/Attachments:
text/plain (1616 bytes) , smime.p7s (2446 bytes)
On 15/05/2008, at 11:43 PM, Rainer Schöpf wrote:

> Are your proposing something like this at the beginning of  
> inputenc.sty:
>
> \ifThisIsXeTeX
>   \switchInputEncodingTo{\optarg}
> \endinput \fi
>
> ? If so, is there a simple implementation of \ifThisIsXeTeX ?

Pretty much, yes.

The ifxetex package provides \ifxetex (simply by checking for the  
presence of \XeTeXversion).

Here's some code that does approximately the right thing: (intended to  
be a self-contained package in a XeTeX-exclusive search path to  
override the normal inputenc.sty)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ProvidesPackage{inputenc}
   [2008/05/15 v0.1 XeTeX-specific inputenc package]
\typeout{%
   Loading a XeTeX-specific package to
   override LaTeX's inputenc package.}
\RequirePackage{ifxetex}
\RequireXeTeX
\DeclareOption*{%
   \PackageWarning{inputenc}{^^J\space\space
     XeTeX input encoding set to '\CurrentOption' for the rest of^^J%
     \space\space '\jobname' and all subsequent files to be read.^^J%
     This message occured}%
   \XeTeXinputencoding "\CurrentOption"%
   \XeTeXdefaultencoding "\CurrentOption"%
}
\ExecuteOptions{utf8}
\ProcessOptions
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It's not very robust at the moment (i.e., the names XeTeX uses don't  
always map to the inputenc names; see <http://www.iana.org/assignments/character-sets 
 > for the full list of encoding names) so I'll have to do something  
about that. But that's the general approach.

I'm happy to maintain such a package that's intended to live in tex/ 
xelatex/inputenc.sty if you like; otherwise, it should probably be  
rolled into inputenc.sty proper.

Many thanks,
Will

ATOM RSS1 RSS2