4

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'
(babel)                I will use the patterns loaded for \language=0 instead.

)) ("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.

! Font LHE/cmr/m/n/12=jerus10 at 12.0pt not loadable: Metric (TFM) file not found.

What is the problem?

2

2 Answers 2

3

The lack of hyphenation patterns is not the problem, as 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.

2
  • 1
    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, 2012 at 16:24
  • @egreg: I wonder if it's really a licensing problem though. I'm sure the original authors would be glad to license the fonts under different terms. Someone should ask the distro maintainers sometime.
    – einpoklum
    Nov 25, 2016 at 23:05
1

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}
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .