On 2016-12-05, mn wrote:
> 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.

By default, LyX selects the correct language package depending on
"use-non-TeX fonts" and document language - this is with "langauge
package = auto". The other GUI settings are there to override LyX's
choice in case you have special requirements unknown to LyX. 

...

>> 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).

You can, however, wrap the call to Minion in a conditonal that does not load
the package if "fontspec" is loaded.

>> 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.

Yes, up-to-date Babel supports fontspec for many languages (including Greek
and Russian).

...

>>> Source View for Format LyX displays
>>> "\inputencoding utf8"
>>> while set for default-output: XeTeX

>> seems to indicate that you are using LyX 2.1 
...
> But version here is 2.2.2,

I still don't get this here:

   "\inputencoding utf8"

is an encoding-change command. 

Do you get this with utf-8 or with "language default"?

Is it causing the problem or solving it?

Where in the document does it occur? Can you give 3 lines of context?


> If babel is so problematic for these engines, should LyX not then ignore
> these babel settings (which I forced on for pdflatex)?

No, there are some languages that are only supported by Babel.

> I do not know how many other (babel)languages pull in inputenc?

Hard to say, even a grep in the *.ldf files will not help, as a language
definition file may load inpuenc or not depending on the font setting.

OTOH, LyX ships with a file "languages" that list for every language whether
it is supported by Babel and/or Polyglossia. This is used with the default
setting "auto" to determine the right package.


>> 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.

But the hidden setting could have sent you back on track...

Günter

Reply via email to