[Tex/LaTex] Xetex Hebrew PDF output problem in Lyx

hebrewlyxpdfxetex

I am trying to compile a document that contains both English and Hebrew. The problem is, that although I have selected Documents | Settings | Use non-tex fonts via XeTeX |LuaTeX, there is no option to export the file to PDF via Xetex (LuaTex always gives me all sorts of errors about not recognizing fonts). I then tried to see if XeTeX is installed, by entering the following into a terminal:

sudo apt-get install texlive-xetex

In case it helps/matters: I'm running Lyx 2.0 on a Linux Mint machine. An extensive search, unfortunately, yielded no answers that worked.

So, my question is: How can I export the document to PDF via XeTeX (I only have the LuaTeX option)?

(P.S. If this question has been previously answered, I'd greatly appreciate a link to the page!)

Best Answer

You need to select the font. For an example, do the following. After

sudo apt-get install culmus culmus-fancy

in LyX go to File > Open, click on the examples button, click on he and open splash.lyx. Then go to Document Settings > Fonts, check Use non-TeX fonts and for all of the fonts, choose Frank Ruehl CLM (this was installed by the culmus package, along with several others). Finally, change Article (Hebrew) to article and compile.

The last change is necessary because (although I'm not sure why), XeTeX does not seem to like the following (which is added by Article (Hebrew):

\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

Following the above steps leads to the following pdf

enter image description here

produced by the following code:

%% LyX 2.1.0dev created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,hebrew]{article}
\usepackage{amssymb}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Frank Ruehl CLM}
\setsansfont[Mapping=tex-text]{Frank Ruehl CLM}
\setmonofont{Frank Ruehl CLM}
\usepackage{url}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\frenchspacing

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}

\title{ברוכים הבאים ל- \textenglish{\LyX{}}}

\maketitle

\section*{כמה נקודות שחשוב לדעת על שימוש ב- \textenglish{\protect\LyX{}}}
\begin{enumerate}
\item \textenglish{\LyX{}} מגיע עם מסמכי תיעוד ועזרה מצויינים \textenglish{—}
מומלץ להשתמש בהם. כדאי להתחיל בקריאת הקובץ \textsf{עזרה$\vartriangleleft$מבוא},
המהווה הקדמה קצרה לתיעוד. לאחר מכן, ניתן להמשיך בקריאת \textsf{עזרה$\vartriangleleft$השיעור~המודרך}
על מנת ללמוד איך להשתמש ב- \textenglish{\LyX{}}.
\item אנחנו מתייחסים אל \textenglish{\LyX{}} כאל \char`\"{}מעבד מסמכים\char`\"{}.
הוא מתוכנן להיות שונה ממעבד תמלילים רגיל כך שמלאכת כתיבת המסמכים תהיה
קלה יותר. מסמכי העזרה והתיעוד יבהירו לך סוגיה זו%
\footnote{האם כבר הזכרנו כמה חשוב לקרוא אותם?%
}.
\item הפלט שיוצא מ- \textenglish{\LyX{}} נראה פשוט נהדר \textenglish{—}
לחץ על \textsf{תצוגה}$\vartriangleleft$\textenglish{\textsf{Dvi}}
וראה בעצמך.
\item \textenglish{\LyX{}} מסוגל לחקות (כמעט) את כל האפשרויות של \textenglish{\LaTeX{}},
והוא מסוגל לייבא קבצי \textenglish{\LaTeX{}}. משתמשי \textenglish{\LaTeX{}}
מנוסים יכולים לפיכך לקרוא את \char`\"{}השיעור המודרך\char`\"{} ברפרוף
ולהעמיק בחלק ''\textenglish{\LyX{}} למשתמשי \textenglish{\LaTeX{}}\char`\"{}
(כל השאר אל תדאגו! לא צריך לדעת \textenglish{\LaTeX{}} בשביל להשתמש
ב- \textenglish{\LyX{}}).
\item \textenglish{\LyX{}} מכיל מגוון של אפשרויות המיועדות עבור משתמשים
הכותבים או קוראים שפות נוספות חוץ מאנגלית. בנוסף לכך, ניתן להתאים
אישית מקשי קיצור, סרגלי כלים ותכונות נוספות רבות. ראה \textsf{עזרה}
\textsf{$\vartriangleleft$התאמה~אישית.}
\item דף הבית של \textenglish{\LyX{}} הוא: \url{http://www.lyx.org}. באתר
זה תוכלו לקבל מידע נוסף על התוכנה, להרשם לרשימות הדיוור וללמוד מהסיור
המודרך של \textenglish{\LyX{}}.\end{enumerate}

\end{document}
Related Question