Scott Kostyshak wrote:

> On Sat, Feb 13, 2016 at 08:54:57PM +0000, Guenter Milde wrote:
>> On 2016-02-13, Scott Kostyshak wrote:
>>
>> > After this commit, when I run the command
>> 
>> >   lyx -e luatex lib/doc/he/Intro.lyx
>> 
>> > it either fails to produce Intro.tex or (on current master) it produces
>> > a Intro.tex with gibberish where there should be Hebrew (at least this
>> > is what Vim shows me).

It is not gibberish. vim fails to detect the encoding cp1255. If you open 
the file with kate it correctly detects the encoding and displays hebrew 
text.

>> No, as Luatex+Hebrew failing is an upstream bug.
> 
> But I am just talking about exporting to .tex and opening in a text
> editor. LuaTeX does not even have a chance if our export to .tex
> corrupts the Hebrew. To be clear, attached are splash_good.tex and
> splash_bad.tex. Do you think it is OK that we now produce splash_bad.tex
> and before we produced splash_good.tex? If you tell me this is fine and
> that there is no encoding issue, then I trust your judgment since I
> know nothing about encoding.

Attached is a diff that was produced after converting the utf8 encoded file 
to cp1255:

recode utf8..cp1255 < heb1.tex > heb1-cp1255.tex
diff -ub heb2.tex heb1-cp1255.tex > x.diff

(recode adds windows line ends, therefore the -b argument for diff)

So, the real diferences of this change are:

1) LyX writes cp1255 encoding instead of utf8

2) LyX adds a \cyrtext command

I don't know if 1) is wanted, but the way it is done is correct: The file is 
written in cp1255 encoding, and luainputenc is loaded with the same 
encoding. 2) looks unnneeded to me.

Obviously, luatex+hebrew is not completely broken, since the utf8 version 
worked. What is the advantage of using cp1255 instead of utf8 now?


Georg
--- heb2.tex	2016-02-14 10:35:23.083348413 +0100
+++ heb1-cp1255.tex	2016-02-14 10:51:29.859358650 +0100
@@ -2,7 +2,7 @@
 %% Do not edit unless you really know what you are doing.
 \documentclass[english,hebrew]{article}
 \usepackage[T1]{fontenc}
-\usepackage[cp1255]{luainputenc}
+\usepackage[utf8]{luainputenc}
 \usepackage{url}
 \usepackage{amssymb}
 
@@ -10,6 +10,10 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
 \providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}
+\DeclareRobustCommand{\cyrtext}{%
+  \fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
+\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
+
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 \usepackage{theorem}

Reply via email to