Creating a Hebrew Document in LyX 2.1 with XeTeX

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 polyglossia and bidi packages. 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...).

  1. 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.
  2. 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.
  3. 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:

  1. Go to Tools -> Preferences -> Editing -> Shortcuts
  2. Type “language” under “Show key-bindings containing:”.
  3. 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 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}

5 thoughts on “Creating a Hebrew Document in LyX 2.1 with XeTeX”

  1. About Italics in David font – the Windows version of David doesn’t have the Italics that the Culmus version has. On LyX, I didn’t manage to get XeTeX to use the CLM version, I guess because it is not installed as a system-wide font by culmus-latex in Windows. I tried installing it manually but Windows 10 doesn’t have a simple way to install .pfa or .pfb font files (it also took a while to find where the files are stored…).
    Do you know a way around this? (Exept for switching to Linux or back to pdfLaTeX)

  2. To use the Culmus fonts in XeTeX you will need a TrueType (ttf) version of the fonts. I’ve just checked the culmus-0.131 package, and it does come with the David font as ttf. You can simply install only those fonts which are ttf and ignore the older formats (pfa, pfb).

  3. Hi there
    When I tried to change the fonts i couldn’t find FrankRuel CLM in the list. (I have found FrankRuel without CLM which basically didn’t work). Culmus is already installed in my PC.
    What can I do?

Leave a Reply

Your email address will not be published. Required fields are marked *