This post complements the basic LaTeX template I gave yesterday for typesetting Hebrew with XeTeX. I’ll walk through the (short) list of steps needed to configure LyX with XeTeX.
Prerequisites
- LyX 2.1 or later (I’ve also tested with the development version of 2.2). I had very limited success with LyX 2.0, so you should probably avoid it.
- XeTeX – I’ve tested with version
3.1415926-2.4-0.9998
which comes with TeXLive 2012, but I guess any recent version will do. - The
polyglossia
andbidi
packages. Again I’ve used those which come with TeXLive 2012. - Good TrueType Hebrew fonts. I recommend Culmus 0.121 or newer. You may also try and use the fonts that come with your operating system, they might work as well.
Setting up the document
Create a new document and open the settings dialog (Document
-> Settings...
).
- Pick a suitable Document class. I recommend “KOMA-Script Article” but “Article” works just as fine. Avoid “Hebrew Article”, as it is broken under XeTeX.
- Under
Fonts
check the box next to `Use non-TeX fonts (via XeTeX/LuaTeX) and select suitable fonts:- Roman: Frank Ruehl CLM. David CLM is also a good choice with somewhat better italics variant.
- Sans Serif: Simple CLM.
- Typewriter: Miriam Mono CLM.
- There is no need to change the Math font.
- Under
Language
select Hebrew as the document’s language.
That’s basically it. You can now write your document and compile it. I would suggest saving these settings as default (via “Save as Document Defaults”) or saving it as a template so you won’t need to repeat those steps.
Writing in English
To insert English text in your Hebrew document, you need to change the current language. The easiest way to do so is to create a keyboard shortcut for it:
- Go to Tools -> Preferences -> Editing -> Shortcuts
- Write “language” under “Show key-bindings containing:”.
- Select “language” under “Cursor, Mouse and Editing Functions” and click “Modify” to set a keyboard shortcut (
F12
is traditionally used for this).
Now you can toggle the current language between English and Hebrew by simply pressing F12
.
Remark about Fonts
It is preferable to use fonts that provide both Hebrew and Latin scripts, as otherwise there might be significant style differences which make the document look weird. It is possible to set a different font for Hebrew and Latin, but care needs to be taken to match styles. To do so, add the following lines to the Preamble:
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}