On 2019-01-13, Scott Kostyshak wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> On Sun, Jan 13, 2019 at 11:27:29AM +0100, Jürgen Spitzmüller wrote:
>> Am Samstag, den 12.01.2019, 19:14 -0500 schrieb Scott Kostyshak:
>> > A recent commit caused the following test to fail:
>> > 
>> >   export/latex/ru-accent-ascii_pdf2

>> Fixed.

> Thanks, the test passes now.

>> This file won't compile with XeTeX/LuaTeX and TeX fonts. I don't
>> think this can be fixed 

The reason for not compiling with LuaTeX was the "libertineRoman" package
selecting non-TeX fonts if detecting Xe/LuaTeX (and LuaTeX not being set up
to support LICR macros for Cyrillic. It would work with "luainputenc", but we
didn't expect the font package to silently use non-TeX fonts.)

>> (but this setting is also not something anybody
>> with a sane mind would do)

* However, it is what LyX ends up doing if 
  - I have a problem a document with default settings, 
  - google for some solution and
  - follow the advice: "Use XeTeX" by clicking on "View PDF (xetex)".
  
* There are use cases for LuaTeX besides a switch to non-TeX fonts, e.g.,
  overcoming the limitation to 16 math fonts, on-demand loading of
  hyphenation patterns, or packages using Lua.


> I added a comment at 70689f8d so that we do not try to test this file
> with XeTeX/LuaTeX and TeX fonts in the future.

I changed the file to work with all exports (with LyX Version 2.4.0dev
(Friday, 11 January 2019) Built from git commit hash 472bdf59) and
removed the comment.
  
However, after re-compilation today, the file now fails with Xe/LuaTeX
because \textcyrillic is used even in Russian text and the remainder of
#6463 bites.

The comments in 7b639d2db2 and the follow ups suggest that there is still
some misunderstanding. 

* The "textcyrillic" and "textgreek" wrappers are "font encoding switch
  wrappers" - they temporarily switch the font encoding to T2A (for
  Cyrillic) or LGR (for Greek).

* The need for "textcyrillic" and "textgreek" wrappers does *not* depend
  on the *input* encoding nor on the TeX engine (8bit/XeTeX/LuaTeX).

* We need the switch if the current font encoding does not contain the
  relevant characters:
  
    textcyrillic is required for font encodings != T2A;T2B;T2C;X2;TU¹
  
    textgreek is required for font encodings != LGR;TU¹
    
    textlatin² is required for font encodings = LGR;OT2;LTH;...

  ¹ The "TU" font encoding is used by XeTeX/LuaTeX for Unicode-encoded
    non-TeX fonts (i.e. with "fontspec").

  ² not automatically provided by LyX. 
    Latin text parts in Greek text must be set to a language using a
    Latin script unless non-TeX fonts are used.
    

Background:

TeX uses 3 encodings:  

 * input encoding   (ascii, latin9, utf8, ...)
  
 * internal encoding  (ascii/Unicode and LICR macros)²
  
 * output encoding == font encoding (OT1, T1, LGR, ..., TU)

² XeTeX and LuaTeX use Unicode (and some LICR macros) as internal encoding.
  They default to utf8 as input encoding and TU as output encoding, i.e. by
  default all 3 encodings happen to be variants of Unicode.

  
  
  
  
Günter


Reply via email to