On 05.12.16 09:36, Guenter Milde wrote:

>>>>>> There might be some incorrect or unexpected behavior when
>>>>>> switching output engines in LyX, because Xetex does not
>>>>>> support input-encoding settings:
>>>>>> To reproduce: Start a document,
> ...
>>>>>> Try to compile the document. It will complain that inputenc
>>>>>> is not suitable for the chosen engine.
> 
>>>>> Not here. It just compiles.
> 
>>>> I just retook the steps I outlined above again and had the same
>>>> error again.
> 
>>> There must be something else in your document. Try with File>New
>>> and see whether this produces the error. If yes, send the
>>> document. If not, tell what else is needed.
> 
>> "Language Package: Always Babel" (a remnant default)
> 
> This is the real reason: Babel-Hebrew is not suited for Unicode
> fonts.

Aha.
Which I thought of as taken care of by LyX, since this was a gui setting.

> Also, it always loads the inputenc package.
> 
> We also need to load inputenc package with one of the Hebrew input 
> encodings. [...] \AtEndOfPackage{% 
> \@ifpackageloaded{inputenc}{}{\RequirePackage[8859-8]{inputenc}}}
> 
> You must use Polyglossia with "non-TeX fonts" and Hebrew (In LyX,
> setting language module to "auto" is recommended.)

Which I will do from now on.
Thanks for the heads up.


>> one line in the preamble loading Minion Pro.
> 
> Actually, loading MinionPro with "use non-TeX fonts" is useless at
> best and could be problematic. The package sets up 8-bit fonts.

I was experimenting with the Xetex-engine I have to use apparently now.
Comparing outputs and fonts and handling opposed to pdflatex.
I was hoping on it to ignore my loading Minion in that way, since I need
to do it that way for pdflatex as setting the Font to Minion via gui is
mysteriously broken (and incomplete).

> Most probabely, the content of the preamble does not matter, anything
> exept an empty user preamble will do (see below).
> 
>> Source View for Format LyX displays "\inputencoding utf8" while set
>> for default-output: XeTeX
> 
> I cannot reproduce this here.
> 
>> To be sure I attached a small file demoing the error as is.
> 
> This reveals one more precondition: Hebrew text in the file. Remove 
> this and it should compile OK. Any text (even ASCII) set to "language
> hebrew" should trigger the error (given the other preconditios), 
> because then Babel-Hebrew loads inputenc.


This pulled-in dependency was completely off-radar for me.
Removing Hebrew text from the file still loads babel but compiles.

> Cannot reproduce with either LyX 2.2 or 2.3(dev).
>
> Now to the mystery:
>
>> Source View for Format LyX displays
>> "\inputencoding utf8"
>> while set for default-output: XeTeX
>
> seems to indicate that you are using LyX 2.1 and a bug in this
> version resulted in a workaround for a bug in your document and a bug
> in inputenc.
> 

But version here is 2.2.2,
as should be clear from the file I attached.

If babel is so problematic for these engines, should LyX not then ignore
these babel settings (which I forced on for pdflatex)?
I do not know how many other (babel)languages pull in inputenc?

> I wonder if you could trigger an: "\inputencoding undefined" error 
> with your document and LyX version when removing the Hebrew text or
> setting the language package to "auto" or "polyglossia".
> 
> In any case, I don't believe we should unhide the inputenc setting 
> with "non-TeX fonts".

Agreed.

That gui setting just sent me on the wrong track to solving this.

If there are not many other scenarios that could trigger roughly the
same or similar behavior it is probably not needed so much as I thought.
(Since I basically shot myself in the foot here.)

Nevertheless I learned another caveat: to really watch out for or decide
very early on top-down what I want to do with a LyX-document.
Some cases allow for experimenting with or switching such settings much
later in the process.

greetings
Mike

Reply via email to