# TeX fails to generate output with Hebrew text: Jerusalem font metric file missing

I have MiKTeX installed on a Windows machine.

I have this simple document, where I'm trying to use Hebrew:

\documentclass[12pt]{article}
\usepackage{ucs}   % package to add unicode support
\usepackage[utf8x]{inputenc}  % adding the UTF-8 encoding
\usepackage[english,hebrew]{babel}
\usepackage{hebfont}
\begin{document}
\sethebrew
Hello world % \textshold{   שלום עולם!}
\end{document}


The compiler says to me:

Package babel Warning: No hyphenation patterns were loaded for
(babel)                the language Hebrew'

)) ("D:\MiKTeX 2.9\tex\generic\babel\lheenc.def")
("D:\MiKTeX 2.9\tex\generic\babel\hebfont.sty") (C:\u1.aux)
("D:\MiKTeX 2.9\tex\generic\babel\lhecmr.fd")
("D:\MiKTeX 2.9\tex\latex\ucs\ucsencs.def")Running miktex-makemf.exe...
miktex-makemf: The jerus source file could not be found.
Running hbf2gf.exe...

hbf2gf (CJK ver. 4.8.0)

Couldn't find jerus.cfg'
miktex-maketfm: No creation rule for font jerus10.



What is the problem?

-
Welcome to TeX.sx! Package babel does not have hyphenation patterns for hebrew (see babel warns of lack of hyphenation patterns for hebrew), therefore you get the warning. Have you installed hebrew fonts? –  Kurt Dec 22 '12 at 18:48
gipc, did none of the answers here resolve the issue? –  einpoklum Oct 13 '13 at 21:10

The lack of hyphenation patterns is not the problem, as @Kurt mentioned.

You're most probably missing the appropriate Hebrew fonts. Download and install the Culmus package. If you're using MiKTeX on Windows, get it from here. If you're on Linux, your distribution should have package(s) with Hebrew support for LaTeX or a specific Culmus package; or you can download the two ivritex tarballs, one of which includes the Culmus fonts.

Also, it is not necessary to use \hebfont; have a look at the source to see what it offers (it's pretty readable even if you're not a LaTeX expert).

If for some reason installing Culmus does not solve the problem, try following the instructions here; they're for TeXLive but it should probably work for MiKTeX as well.

-
Yes; none of the Hebrew fonts is in TeX Live nor, I'm told, in MiKTeX; probably a licensing problem. So one has to install the fonts separately. –  egreg Dec 23 '12 at 16:24

One way to typeset Hebrew using TeX is to use the Polyglossia package, which requires the XeLaTeX engine rather than the usual LaTeX or pdfLaTeX.

All modern TeX implementations include the XeLaTeX program. To run XeLaTeX from the command line, simply type xelatex instead of the usual latex or pdflatex. If you normally run LaTeX from a button in your text editor, there should be a setting to change it to XeLaTeX. Depending on the editor, adding the following "TeX directive" to the top of your TeX source file may instruct the editor to use XeLaTeX automatically:

% !TeX TS-program = xelatex


(Make sure there is nothing else on the same line, not even a subsequent comment.)

The basic use of Polyglossia is illustrated below, with a document containing English and Hebrew.

Important: The line \setotherlanguage{hebrew} loads the Bidi package, and therefore this line must be run after most other packages are loaded, otherwise it will generate a "Package bidi Error". So if you need any other \usepackage lines, make sure to put them before this line.

The font name inserted as the mandatory argument in braces after \newfontfamily can be any font on your system containing Hebrew characters. (In my example, SBL Hebrew.) There must be no extra white-space within the braces before or after the font name (so, for example, { SBL Hebrew} or {SBL Hebrew } won't work). The optional argument [Script=Hebrew] is necessary for the vowels (nekudot) to be placed correctly.

% !TeX program = xelatex
\documentclass{article}
\usepackage{polyglossia}
\usepackage{xltxtra}

\defaultfontfeatures{Mapping=tex-text, Scale=MatchLowercase}
\setdefaultlanguage{english}
\setotherlanguage{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew]{SBL Hebrew}

\begin{document}
This is a regular paragraph in English.

\begin{hebrew}
עכשיו אני כותב קטע שלם בעברית.
\end{hebrew}

Now back to English, the default language.

I will insert some \texthebrew{מלים בעברית} into this sentence.

\begin{hebrew}
עכשיו אני כותב קטע בעברית עם \textenglish{English words} באמצע.

אֶפְשָׁר לִכְתּוֹב גַּם עִם נְקוּדוֹת!
\end{hebrew}

\end{document}

-
The ! TeX instruction only works with a few editors, cf. When and why should I use % !TEX TS-program and % !TEX encoding? –  doncherry Dec 23 '12 at 6:55