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 for XeTeX.
Prerequisites
- LyX 2.1 or later (I’ve also tested 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
polyglossiaandbidipackages. Again, I’ve used the versions that come with TeXLive 2012. - Good TrueType Hebrew fonts. I recommend Culmus 0.121 or newer. You may also try using 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 well. 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 a somewhat better italic 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 defaults (via “Save as Document Defaults”) or saving the document as a template so you won’t need to repeat these steps.
Writing in English
To insert English text into 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
- Type “language” under “Show key-bindings containing:”.
- Select “language” under “Cursor, Mouse and Editing Functions” and click “Modify” to set a keyboard shortcut (
F12is 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 that 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:
newfontfamilyhebrewfont[Script=Hebrew]{David CLM}
newfontfamilyhebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
newfontfamilyhebrewfontsf[Script=Hebrew]{Simple CLM}
