# IDE / Best known method for writing Hebrew documents with LaTeX

I usually use LyX to prepare lecture notes, course summaries, etc. The reason I use LyX and not LaTex directly is twofold -

1. I usually need to type in real time - summing a lecture. I think for this I'd still need LyX.
2. I write all these documents in Hebrew, and it seems to me that writing Hebrew documents with LaTeX will be a real pain (different direction of text, etc.).

So I'm looking to solve #2 - have you ever used LaTeX for a right-to-left language effectively? What IDEs support this? What do you do when you need to write a document in such a language?

-
TeXworks has right-to-left abilities, and the integrated PDF viewer gets you at least a very quick cycle of compilation and seeing the result. However, I don't speak Hebrew, so can't say that it definitely works. –  Joseph Wright Jul 30 '10 at 5:56
@vanden thanks for the bounty! –  Amir Rachum Jul 30 '10 at 7:18
No worries. The question seems important, needed love, and is well outside my abilities to address. –  vanden Jul 30 '10 at 16:03

I wouldn't necessarily say you need LyX for quick writing of documents/note-taking (it's more to ease the learning curve), but the following method should work well with either plain LaTeX or LyX I believe.

At present there exist the excellent babel and hebfont packages. The combination of these two packages is likely the best option for typesetting Hebrew text. The former provides support for Hebrew characters/text encoding, RTL rendering, and switching between Hebrew/Latin/other scripts, while the latter provides a variety of fonts for rendering Hebrew characters.

You can turn 'Hebrew mode' on simply with the \sethebrew macro, and off again with the \unsethebrew macro.

Boris Lavva has written a very useful guide to typesetting Hebrew in LaTex 2e, which should get you going. It would probably be fairly straightforward to set up a template for Hebrew documents. Apart from a handful of new macros to learn, you should essentially be able to use Hebrew in LaTeX as you would normal LaTeX.

Note: There is even a hebtech document class for preparing formal technical documents/theses in Hebrew, if you find the need.

-
I think this doesn't address Amir's question per se, as I find that it regards to the process of authoring a document more than than the LaTeX packages and commands to use. Also, babel does have numerous issues and Vafa Khaligi's bidi package used with XeTeX and polyglossia are probably the way things are going (see his answer below). –  einpoklum Oct 29 '11 at 10:27
@Eyal Rozenberg: With all due respect, if it didn't address Amir's question, he would not have accepted it, and people would not have up-voted it. Case in point that you're wrong. :-P –  Noldorin Oct 29 '11 at 19:34

I don't write in Hebrew, but I do use Lyx! The wiki has instructions on how to set it up for Hebrew at lyx.org/Windows/Hebrew.

The URL says it's for Windows, but a quick check on my Mac shows that it works on other operating systems as well.

The link also shows how to set up a shortcut to switch back and forth between one language setting and another, so you should be able to do this in your lecture and go smoothly between English and Hebrew (if you need that).

-
I really don't like lyx!!!! It is my own prejudice, but I think it is halfway between Word and actual LaTeX, and I don't see it as an option. But you got +1 from me anyway, as I think your answer is useful :) –  Vivi Jul 31 '10 at 2:28
@reemrevnivek as I said, I already use LyX, but I'm looking for a solution to write in Hebrew with LaTeX. –  Amir Rachum Jul 31 '10 at 14:50
@Amir - ...and this doesn't do precisely that? I thought this was exactly what you wanted! –  Kevin Vermeer Jul 31 '10 at 15:42
@Vivi - Yeah, "WYSIWYM" definitely a hybrid between an IDE and a WYSIWYG editor. I understand why you might call it something less proper, but it is useful in some situations, when you don't really have time for the compile-preview cycle. It also cuts the learning curve down sharply for new users. –  Kevin Vermeer Jul 31 '10 at 15:55
@reemrevnivek: it definitely cuts the learning curve down, so I think it is a good way to start learning latex! –  Vivi Jul 31 '10 at 20:08

I advise you to use polyglossia package in XeTeX. the bidirectional support in babel is not really powerful but you have bidi package for xelatex that is very powerful. bidi for instance allows you to typeset tabular RTL, you can have almsot any kind of link by usng hyperref package in RTL documents, color works almost works as expected, and bidi supports a lot of extra packages for example, you can use the wonderful wrapfig package in RTL documents by using bidi. Furthur, there are bugs in bidirectional typesetting bugs of babel that are fixed in bidi. As an Example, consider this minimal document:

\documentclass{article}
\makeatletter
\input{rlbabel.def}
\@rltrue
\makeatother
\begin{document}
\fbox{\begin{minipage}[t]{0.8\textwidth}
\begin{itemize}
\item This is a test
\end{itemize}
\end{minipage}}
\end{document}


Gives:

but

\documentclass{article}
\usepackage{bidi}
\setRTL
\begin{document}
\fbox{\begin{minipage}[t]{0.8\textwidth}
\begin{itemize}
\item This is a test
\end{itemize}
\end{minipage}}
\end{document}


Gives:

-

The method I use is very effective.

Try this:

\documentclass[hebrew]{article}
\usepackage[utf8x]{inputenc}
\usepackage{babel}
\begin{document}
\selectlanguage{hebrew}
בן זונה.
\end{document}


You can switch to other languages by using \selectlanguage{<language>}.

-