On 2012-02-14, stefano franchi wrote:
> On Tue, Feb 14, 2012 at 8:05 AM, Jean-Marc Lasgouttes

>> tex2lyx is not really the culprit. The file you attach is broken : it
>> does not use xetex/luatex, but it does use "Unicode (XeTeX) (utf8)" as
>> encoding. As a result, the latex export of the file does not specify
>> any encoding, and tex2lyx is not able to guess it.

> Sorry, but I don't understand what you mean by "broken" here. If I set
> the encoding to pure Unicode (isn't that what "Unicode (XeTeX) (utf8)"
> means?) shouldn't that be enough to specify that the file is
> Unicode-encoded? 

The setting "Unicode (XeTeX) (utf8)" specifies that the LyX-generated LaTeX
file should be utf-8 encoded Unicode 

* without "forced" substitutions (for characters the halfway utf8 support
  of 8-bit LaTeX does not understand or does wrong), and
  
* without calling the "inputenc" package.

This means that in the exported file, utf-8 encoding is used but there is no
specification of the used encoding inside the *.tex file.

You can consider this an "expert setting": it allows to circumvent 
limitations but usually requires additional custom preamble code to
produce valid LaTeX files.

Similar to the use of ERT, LyX does not guarantee proper working.


> That seems obvious to me (which of course may only reflect my ignorance
> of Lyx code). If that's not true then I do not understand what is the
> meaning of the Document>>Settings>Language>>Encoding value.


It seems that tex2lyx relies on the optional argument in the

  \usepackage[<encoding>]{inputenc}
  
line to determine the *.tex file encoding.

IMV, it should try utf8 first in case this does not give a result.

* if the file is pure ASCII, everything is fine
* if the file is utf8 encoded, fine too
* if another encoding is used, an error occures: try again with the second
  guess.
  
Günter

Reply via email to