On 2012-02-15, Georg Baum wrote:
> Jürgen Spitzmüller wrote:

>> If other encodings are used, LuaTeX uses the "luainputenc" package, which
>> has the same syntax than inputenc, i.e.

>> \usepackage[<enc>]{luainputenc}

>> Maybe we have to care about that.

> luainputenc is already handled.

Fine.

> What is missing for luatex is to set 
> use_non_tex_fonts to true and the encoding to utf8 if luainputenc is not 
> used. Unfortunately this is not so easy as with xetex.

"use_non_tex_fonts" is actually a toggle to use the "fontspec" package 
(coupled with the use of polyglossia if the language-package
setting is set to auto, if I remember right).

The "fontspec" package can be used with the XeTeX and LuaTeX engines but not
with TeX and eTeX.

This means that tex2lyx should look for

  \usepackage{fontspec}

and set "use_non_tex_fonts" accordingly.

(IMV, the name for this setting should also be changed:
  - use_non_tex_fonts
  + use_fontspec
this would prevent much confusion.)

The default encoding (if neither "inputenc" nor "luainputenc" is found) may
be chosen according to use_non_tex_fonts:

True 
  XeTeX or LuaTeX engines must be used to compile
  
  --> assume their default encoding (utf8) as file encoding.

False 
  any tex engine can be used to compile
  
  --> assume either the 8-bit tex default (ASCII) or utf8 as file encoding.
  
Actually, utf8 should be a safe bet in any case when no "inpuenc" or
"luainputenc" is found, as ASCII is a subset of utf8 and no tex engine
understands 8-bit encodings (latin-1 ...) without inputenc or a similar
package.

UTF8 decoding errors should lead to a message: "unknown encoding, please
specify the file encoding". If tex2lyx is called from the LyX-GUI, this
error should lead to a pop-up dialogue where you can specify an encoding.

Günter



  


Reply via email to