Subject: Hebrew LaTeX vs. MS-Word

From: Shlomi Fish <[email-masked]>
Date: Tue, 19 Jun 2001 03:45:41 +0300 (IDT)

So far I have written the vast majority of my Hebrew documents in
Microsoft Word for Windows. I find its behaviour relatively frustrating;
Some things, like putting images in floating frames are known to cause too
many problems; and some things which should be easily accessible require
too many keystrokes or mouse movement to accomplish (E.g: starting an
equation, or making a string subscript).

I heard excellent reviews of LaTeX for writing Latin documents, and I'm
sure that if that was the case, I would have probably prefer it over Word.
However, the documents in question are the project reports of my friend
and I, which I believe should be in Hebrew, as they are intended for an
Israeli audience.

Now, I heard mixed results on using LaTeX to write Hebrew documents. Orr
Dunkelman who is an open LaTeX advocate and even gave a lecture about it
to the Haifa Linux Club, said Word is better when writing Hebrew
documents. Tzafrir Cohen used Hebrew LaTeX for some of his lectures, but
he admitted that LaXeT was not a good an offering as LaTeX. I met someone
from my department, who used Hebrew LaTeX ( I think it was this package:
http://www.dsg.technion.ac.il/heblatex/README.html ) and said it was very
good, even without using LyX.

Now I have the following questions in order:

1. Are the BiDi algorithms of LaTeX compliant to the Unicode standard or
to something else that is usable?

2. Can I use Hebrew TrueType fonts inside my LaTeX document? I know TeX
uses a subsystem called MetaFont to handle its fonts, but does it support
Hebrew fonts and/or TrueType Fonts well?

I saw Tzafrir's lectures and the Hebrew fonts there are not very good, and
if possible I'd like them to be better.

3. Are there any horror stories (or vice versa) of working with LyX on
Hebrew LaTeX documents? I may require a WYSIWYG editor to perform several
specific tasks easily, so I'd like to know how well it can handle what I
input it with.

4. Can LyX handle user-defined logical styles (which I suppose will be
implemented as macros) very well? Or do I have to edit a separate document
with it and then cut and paste it to my main LaTeX source.

So, in order to preserve my sanity over writing a several dozens of pages
long document that contains a lot formatting styles, equations, images and
bidirectionality, for all of which Word is sub-standard - should I or
should I not use Heb-LaTeX?

Regards,

	Shlomi Fish

----------------------------------------------------------------------
Shlomi Fish        [email-masked]
Home Page:         http://t2.technion.ac.il/~shlomif/
Home E-mail:       [email-masked]

A more experienced programmer does not make less bugs. He just realizes
what went wrong more quickly.

---

From: "Nadav Har'El" <[email-masked]>
Date: Tue, 19 Jun 2001 08:37:53 +0300

> sure that if that was the case, I would have probably prefer it over Word.

I can second these reviews. I've been using MS-Word on-and-off for over
10 years (I think I even used the DOS version they had), and TeX for 7
years (before switching to TeX on Unix, I was using troff), and have written
everything from one-page letters to 100 page documents in both of them,
in both English and Hebrew.

I can tell you I really prefer LaTeX. People are surprised to hear that,
but I find LaTeX, whether Hebrew or English, to be more *convenient* than
MS-Word - on long documents. If you ever had the (mis)pleasure of writing
a 100-page document in MS-Word, you probably know that Word makes it very
easy to start out, but once the document gets long you start bumbing into
those not-so-easy-to-carry-out necessary operations, hitting more and
more bugs, and start to get annoyed by repetative and tedious tasks.
Sometimes you start to hit hard limits, like one time I had to enter almost
a hundred large pictures into a Word document, and it just croaked on them,
so I ended up writing code which "fakes" Word headers and footers on the
pictures using Postscript tricks, instead of actually putting them in the
main document.

> and I, which I believe should be in Hebrew, as they are intended for an

Do you mean projects for the Technion?
I handed in several CS assignments in the Technion in English, and normally
the TAs do not care. Heck, the comments in code are usually in English too.
Someone who is not fluent in English really doesn't have much business being
a TA...

> good, even without using LyX.

When I wrote my MSc thesis (I was forced to do so in Hebrew - but the rules
are now different), in Hebrew using LaTeX, I found out 3 things:

  1. The LaTeX Hebrew support that existed then (for LaTeX version 2.09,
     which is different from the current LaTeX 2e) was very "unfrofessional".
     It handled fine the simple cases, but a really good support would need
     to support 100% of the standard (English) LaTeX features in Hebrew
     too. I ended up spending at least 1-2 month of coding to fix stuff like
     handling of headers, two-columns, table of contents, footnotes, and
     much much more, and resulted in a new package described in
	ftp://ftp.ivrix.org.il/pub/ivrix/src/cmdline/tex/README
     This package is guaranteed to give you quality results (as much as
     anything free can be guaranteed), almost the same as English LaTeX,
     but unfortunately it builds on the LaTeX 2.09 version, which is now
     considered "passe" (I said "considered" because it is actually still
     usable, and I personally continue to use it). You can see an example -
     my thesis, in
	http://www.math.technion.ac.il/~nyh/thesis.ps.gz
 
     There now exists LaTeX 2e Hebrew support, but I have never actually
     tested its quality, and its coverage of standard LaTeX features.

  2. The Metafont fonts were fine for experimentation, but look so *bad*
     that I couldn't bring myself to turn in a thesis written with them.
     So I found out how to use Truetype fonts in TeX, and explained it in the
     same README.

  3. To edit the Hebrew/English file, I found it is best to work with the
     Vim editor, using some very simple macros described in the same README.

> to something else that is usable?

Not quite... You enter Hebrew in ISO-8859-8 encoding, but bidi is
explicit: the paragraph has some language (normally Hebrew, in a Hebrew
document), and if you need to write something in English you need to
enclose it with \L{...} which changes both the font and direction. There
are other macros for other combinations of font/direction changes, but
this is beyond the scope of this post.

> if possible I'd like them to be better.

Yes, you hit the nail on the head: the metafont Hebrew fonts are crap.
As you can see in the the above README and thesis example, using truetype
fonts is possible (not trivial, but possible). But once you set up
your system for that once, the next time using truetype fonts is trivial -
so I *never* use the metafont Hebrew fonts any more for anything (not
even slides).

> specific tasks easily, so I'd like to know how well it can handle what I

Just remember that LyX is only an option - your other option is to edit
the text file directly. it's not as bad as you might think.

Good luck!

-- 
Nadav Har'El                        |      Tuesday, Jun 19 2001, 28 Sivan 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |An error? Impossible! My modem is error
http://nadav.harel.org.il           |correcting.

---

From: Tzafrir Cohen <[email-masked]>
Date: Tue, 19 Jun 2001 08:52:33 +0300 (IDT)

> to something else that is usable?

The basic bidi support in tex (actually - in e-TeX) does not support
implicit bidi. It only supports explicit bidi. And all the higher levels
directives use explicit bidi as well. See also:

  http://ivrix.org.il/mailing-lists/ivrix-discuss/2001/06/0016.html

> if possible I'd like them to be better.

So far I haven't had much success here, but I only tried following a
recepie by Nadav Har'el:

However, I probably missed a little detail there. I believe that this
basically worked for Sivan Toledo.

One thing I haven't tried yet is the method proposed by Dekel Tsur:

  http://www.math.tau.ac.il/~dekelts/lyx/ttf.html

(Things seem to work better at TAU).

> specific tasks easily, so I'd like to know how well it can handle what I

What exactly do you want from a wysiwyg editor?

> with it and then cut and paste it to my main LaTeX source.

Yes. You can define styles. That requires some messing, though.

Alternatively you can add some definitions in the latex preamble of the
lyx document.

> should I not use Heb-LaTeX?

Why not?

-- 
Tzafrir Cohen
mailto:[email-masked]
http://www.technion.ac.il/~tzafrir

---

From: Tzafrir Cohen <[email-masked]>
Date: Tue, 19 Jun 2001 09:08:34 +0300 (IDT)

>      Vim editor, using some very simple macros described in the same README.

There is a package of vim macros for latex editing (and running, and
ispelling, etc.)

  http://tiger.technion.ac.il/~tomer/TeX/

This is what I normally use for latex editing.

There is also a the he2 editor:

  http://he2.sf.net

It has some unique features for hebrew latex editing. OTOH it may lack
some advanced editor features that vim has.

> enclose it with \L{...} which changes both the font and direction.

and \R{} for hebrew text inside an English text.

> the text file directly. it's not as bad as you might think.

I generally like it for feeding large amounts of texts, since I can see
the hebrew text well. It also helps me think if I can see the equsions in
fron of my eyes (although I can always work with a copy of xdvi in a
near-by window).

One thing that the bidi support of lyx doesn't handle well (and perhaps
there is no way for it to handle well) is LaTeX macros in hebrew text:
when there is no bidi support (or with vim's "so-called" bidi support) I
have no problem figuring exactly how the text flows and how are the
macrows set. When bidi gets into the picture, things get messier for me.

---

From: Shlomi Fish <[email-masked]>
Date: Thu, 21 Jun 2001 14:17:49 +0300 (IDT)

> pictures using Postscript tricks, instead of actually putting them in the

I had little doubt LaTeX was better than Word for writing Latin documents.
However, I asked about Hebrew support.

> Someone who is not fluent in English really doesn't have much business being

Yes, I mean Technion projects. I suppose I could hand them in English if:

1. They will not require them to be Hebrew.

2. My partner will be comfortable with writing it in English.

3. I can get myself to writing a 100-pages long technical document in
English.

4. The report will be made available in the Lab's homepage. If it will be
in English, then Israeli people may find it harder to read (but proabably
not impossible) Then again, if it's in Hebrew, then International audience
will not be able to read it at all.

BTW, I study EE, not CS.

BTW 2: I know some guy who finished his B.E. in Electrical Engineering in
the Technion. He does not know English well, and from what he told me he
only had to read an English book once in the course of his studies. He
does not plan to get a second degree soon, but he may.

> 	http://www.math.technion.ac.il/~nyh/thesis.ps.gz

I checked it. Does not look too bad, but maybe its quality has been
reduced because it is previewed by Ghostscript for Windows, and I have to
set various paramters.

>      So I found out how to use Truetype fonts in TeX, and explained it in the

Well, I asked about it. So I thank you now.

>      Vim editor, using some very simple macros described in the same README.

Well, I like gvim enough to work with it. Problem is that our Linux farms
do not carry gvim (they only carry the console vim). But I have it at
home; I could ask the farm guys to install it; and maybe the Laboratory's
farm has it.

> this is beyond the scope of this post.

Well, it is OK for me, I suppose. I don't need implicit conversion and
even in Word I need to press the Ctrl+Shift and Alt+Shift combinations.

> the text file directly. it's not as bad as you might think.

I did not say it is bad, but I thought a WYSIWYG environment may be
sometimes handy, especially if my formulas get very complex.

Regards,

	Shlomi Fish

> To unsubscribe from this group, send an email to:
> [email-masked]
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

---

From: Oleg Goldshmidt <[email-masked]>
Date: 21 Jun 2001 17:02:55 +0300

> sometimes handy, especially if my formulas get very complex.

I deal with documents with complicated maths frequently. I have a very
strong opinion on this matter: the more complicated your formulas are
the easier it is to input them in LaTeX relative to WYSIWYG. 

The statement above is based on experience, but it is also easy to
"prove" (note the quotes): the LaTeX typing of math is highly
optimized, in the best case for WYSIWYG you will do the same kind of
typing. Normally though you will need to do a lot of travelling over
menus and popups to do even simple things like sub- and
superscripting, Greek letters, special symbols, alignments, etc.

With a bit of practice, you will find it rather amazingly useful to
have an ascii representation of your document, with all the tricks and
math.

-- 
Oleg Goldshmidt | [email-masked] 
If it ain't broken, it hasn't got enough features yet.

---

From: Shlomi Fish <[email-masked]>
Date: Fri, 22 Jun 2001 17:32:51 +0300 (IDT)

> superscripting, Greek letters, special symbols, alignments, etc.

Yes, but sometimes I'd like to see how my equations look while I edit
them, so I'll know just what to do. On a regular basis I'd like to work
with the LaTeX source, but I'm not ruling out the case when a GUI display
would be useful.

Regards,

	Shlomi Fish

---

From: Tzafrir Cohen <[email-masked]>
Date: Fri, 22 Jun 2001 21:11:04 +0300 (IDT)

> with the LaTeX source, but I'm not ruling out the case when a GUI display

Another option is to keep on {x|win|k}dvi window open and update it from
time to time.

> > have an ascii representation of your document, with all the tricks and

Well, at least I haven't gotten to that point...

---

From: Oleg Goldshmidt <[email-masked]>
Date: 22 Jun 2001 23:42:48 -0400

> Another option is to keep on {x|win|k}dvi window open and update it from

I use Emacs (usually XEmacs) for editing. Here is a (rather crude, I
admit) hack I use:

;; use AUCTeX mode by default

(require 'tex-site)

(setq-default
 TeX-view-style
 '(("."
    "dvips -j0 %s -o %f; gv_pid=$(ps auxw | egrep \"gv[ \\\\t]+%f\" | grep -v grep | awk '{print $2}'); if [ -z \"$gv_pid\" ]; then gv %f; else kill -SIGHUP $gv_pid; fi")))

What this does is the following: I edit a LaTeX file, hitting "C-cC-c"
repeatedly runs latex as needed, then the "View" command starts gv
transparently, where I see the final result. I continue editing, then
hit "C-cC-c" again. On the next view, HUP will be sent to gv, and the
final result will be updated. Of course, you can also update from gv
itself.

Please don't gripe about remembering "C-cC-c" - it's the default, it
can be modified, and there are pull-down menus, too. The point is, you
can keep track of your final result at very little cost.

I prefer to look at the final postscript rather than dvi, because IIRC
some things are only done at the dvips stage. Maybe this is
out-of-date, and xdvi and friends are smarter now. For some reason
that I cannot elucidate now I have always disliked xdvi.

-- 
Oleg Goldshmidt | [email-masked] 
If it aint't broken it hasn't got enough features yet.

---

From: "Nadav Har'El" <[email-masked]>
Date: Sat, 23 Jun 2001 00:30:23 +0300

> that I cannot elucidate now I have always disliked xdvi.

It is true that some things can only be viewed on the postscript output (e.g.,
if you include postscript "tricks" in your document, and color "specials")
but mostly everything can be shown in xdvi (including even postscript
pictures, which xdvi converts to bitmaps).

There are several reasons why I disagree with you, and find xdvi more
convenient to use when editing a TeX document:

  1. When xdvi notices that the dvi file changed, it rereads the file and
     reshows the document on the same page. No need to kill it, restart it,
     find the page again, and so on. Very convenient for interactive editing
     (e.g., see what that humongous equation actually looks like).

  2. Xdvi is much quicker in displaying pages, moving to the next page, etc.,
     than gv. It also has a very quick "zoom" feature (with the moust buttons).
     You also save yourself the need to run "dvips". All these time-savings
     are useful for interactive work.

  3. Xdvi has beautiful anti-aliased fonts - so the output looks *way* better
     than in ghostview (regardless if the fonts come from metafont or ttf).
     Note that now that gv exists, and it also has an anti-alias feature,
     gv is good in this respect too.

-- 
Nadav Har'El                        |     Saturday, Jun 23 2001, 2 Tammuz 5761
[email-masked]             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |If you're looking for a helping hand,
http://nadav.harel.org.il           |look first at the end of your arm.