Notes about Hebrew Latex

Working with Hebrew Latex is quite an ordeal. Below are some notes about my experience, which will hopefully help others. I don't really understand most of the issues involved so I will stick with what I (think I) know. This is not meant as a tutorial, and you will benefit from these notes more if you know some latex.

If you have questions or comments (or better solutions!) please let me know. I'll do my best to answer and keep this site up to date.

Installation

I can't help much here. There are several flavors of tex and latex. Some support hebrew natively and others need add-ons. My best suggestion is to find a distribution that works out of the box, and not mess around with anything else. I am quite happy with Rama Porat's somewhat old installations: tex (choose either the 'tex for unix' or 'tex for windows/newer system for windows/'. These links won't work outside the Hebrew University's network.

I have heard that new installations of Miktex work with Hebrew out of the box. I haven't tried.

creating a latex document in Hebrew is also not easy. The best solution I know of is LyX.

Fonts

Older versions of hebrew latex come with lousy fonts. There is now a very good free font for hebrew called Culmus. However, installing it for latex is nontrivial. The Miktex distribution (including the one linked to above) includes these fonts. For unix I suggest looking on the web. With the help of Lior Silberman I once copied the entire font tree from the windows distribution to unix and got it to work, but I don't recommend this.

It is also rumored to be possible to use true type fonts with pdflatex (and even plain latex as well). Despite several attempts, I haven't managed to get it to work. If you can get Culmus working, that is your best bet.

Note that if you use LyX then the fonts you see on the screen have nothing (or little) to do with the fonts that will appear in the dvi/ps/pdf version of the document.

Bold fonts

If you must work with the old latex fonts, the most annoying problem is the lack of a bold font. To fix this, place the the following command in your document's preamble:

\renewcommand{\textbf}[1]{\hadgesh{#1}}

If hebrew latex is working, this should work. I am grateful to Azriel Levi for telling me about this solution.

This command causes all bold text to be printed several times, slightly shifted. this has the effect of producing "bold" text, thought the quality is not great.

another disadvantage is that the command <\pre>\textbf{some text...}

will cause latex to typeset 'some text...' in an hbox, and no line breaks will be inserted. you have to do that yourself.

by the way, you might want to redefint the \emph and <\textit commends as above, since the hebrew italics is quite bad for emphasiseing. IMO bold is better.

Fancy Headers

The fancyhdr package has some strange bug which causes it to typeset headers and footers in the wrong order and using the wrong fonts. It apparently has to do with what language tex is typesetting when it decides to breakl the page, but I'm not really sure.

I'm sure it's possible to write something nicer, but the following works. copy the fancyhdr.sty file to your local tex tree under the name fancyhdr-heb.sty (or some other name if you prefer) and change the lines

\def\@fancyhead#1#2#3#4#5{\sethebrew{
#1\hbox to\headwidth{\fancy@reset\vbox{\hbox{
\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill
\parbox[b]{\headwidth}{\centering#3\strut}\hfill
\llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5}}

with

\def\@fancyhead#1#2#3#4#5{
#1\hbox to\headwidth{\fancy@reset\vbox{\hbox
{\rlap{\parbox[b]{\headwidth}{\raggedright#2\strut}}\hfill
\parbox[b]{\headwidth}{\centering#3\strut}\hfill
\llap{\parbox[b]{\headwidth}{\raggedleft#4\strut}}}\headrule}}#5}

(that is, irase the sethebrew command and matching closing bracket). In my file this is the paragraph starting at line 254. Then use fancyhdr.heb instead of fancyhdr (don't forget to update the tex directory -- run texhash, or use miktexs upadte app).

Makeindex

The makeindex package does not work correctly with hebrew documents. I've written a small perl script (and config file) which solves this. The script is used just like makeindex: for a document called file.tex, use hebindex file<\font>. The script doesn' support other makeindex command line options.

The script is written for unix. I'm not sure what needs to be done to make it run on windows; probably delete the first line and change the name to hebindex.pl (and make sure perl is installed!).

What the script does is to translate latex character codes into hebrew characters and runs makeindex on the resulting file. To make this work on your platform you first need perl installed. You may also have to edit the hebindex file slightly, e.g. to update the character table if you are using another character encoding.

Table of contents

Note that the table of contents file for Hebrew documents is 'file.cot', and not 'file.toc' as in the English case.


department home

my home