On 2016-12-04, mn wrote:

> On 04.12.16 16:09, Guenter Milde wrote:
>> On 2016-12-03, mn 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, go to setup:

>>> - first try something for pdflatex and
>>> define under language: input encodig to other (here it was utf8)
>>> (then close dialog, reopen dialog and)

>> Which encoding did you select?

> Switched from "language default" to "Custom: utf8"

I suppose the standard "Unicode (utf8), right?

>>> - switch to fonts, set these to any combination of luatex/Xetex.

>> Did you mean "tick the 'use non-TeX fonts'" button which activates the
>> "fontspec" package for use of Unicode-encoded fonts?

> Yes, switch to "Use non-TeX fonts (via XeTeX/LuaTeX)"

>> With "use non-TeX fonts", both the input encoding and the font
>> encoding are set to "utf-8", overriding any setting under
>> Settings>Language>Encoding.

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

> ###
> ! Package inputenc Error: inputenc is not designed for xetex or luatex.
> (inputenc)                only UTF-8 supported.

> See the inputenc package documentation for explanation.
> Type  H <return>  for immediate help.
>  ...

> l.158 \endinput

This should not happen with "use non-TeX fonts".

> For xelatex or lualatex save the document in UTF-8 encoding
> and do not use inputenc, or use the [utf8] option.

LyX does not use inputenc if "non-TeX fonts" are used. The setting under
language>encoding is ignored.

> ###

> But I found that my usual way of invoking MinionPro for default roman
> for pdflatex is apparently the culprit:

> The preamble-code
> \usepackage[textosf,mathlf]{MinionPro}

> seems to trigger the behavior outlined above.

> Although I fail to see why.
> None of the related .sty-files pull in inputenc?

The full log will tell you, which file loaded inputenc.
All loaded files are logged and nesting is indicated by ().


>>> But then going back to doc-settings and just trying to unset the
>>> other(utf8)-option back to default is inaccessible (greyed out).
>>> To do anything about that you have to first also unset your
>>> font-settings back to choices for pdflatex.

>> Did changing the input encoding setting under Language>Encoding help
>> to make
>> your document compile again? Which setting was required? Did it work with
>> "non-TeX fonts" later?


> Yes. For both tests when it failed and also when I noticed this behavior
> in another document: unsetting first "Use non-TeX-fonts" and then
> changing input encoding back to default, then rechecking "Use
> non-TeX-Fonts" produced a PDF that compiled with XeTeX and looked as
> expected.

Strange. 

> Together with the apparent trigger mentioned above I currently do not
> understand why un/checking inputenc:utf8 in LyX's gui has any influence
> on this situation if it is ignored by LyX for XeTeX in he way you decribed.

It would be interesting to see the diff of the exported files with
and without Language>Encoding set to utf8. 
You may spot a difference either with View>Source (complete document or
preamble) or File>Export>latex (XeTeX).

Günter

Reply via email to