I am writing a Hebrew document that also contains in-line English text. For that, I am using polyglossia to facilitate multilingual typesetting.

A MWE is:

\setmainfont{Times New Roman}
\newfontfamily\hebrewfont{David CLM}
% \usepackage{bidi} % really needed?
פונקציה מקבוצה 
 מסומנת $f:X\to Y$.

output I want to be able to produce this scheme of LaTeX file with LyX's Export to LaTeX (XeTeX) tool.

I prefer achieving this goal with the LyX GUI, and not by writing the necessary commands in the Latex preamble found in the Documents settings.

At the moment the settings in LyX->Preferences->Language read the following:

preferences window

It looks like one has control over what command should be used to start an English environment. In this case it is \selectlanguage{$$lang}. But these settings rather produce the following environment when English is inserted in a separate line

⟨the English text⟩

and the following when English is inserted as in-line:

\textenglish[variant=american]{the English text}

So, I have three questions:

  1. Why is the variant=american option there for the inline English? I can't see anywhere in the settings where it is called.
  2. Where the \selectlanguage{$$lang} has its effect?
  3. I am looking at the exported pdf file, and the left-to-right and right-to-left issue is dealt fine, without surrounding \textenglish{} with \LRE{⟨...⟩}. Is there a real need for the bidi package here? If the answer is yes, then how do I instruct LyX to work with the bidi package?

1 Answer 1


Ad 1. variant=american is set in LyX' language definition file for English. This is also actually the default variant for polyglossia English.

Ad 2. Nowehere. This is only used with babel. With polyglossia, LyX always use polyglossia's own language switching commands (the <language> environment)

Ad 3. No. Polyglossia automatically loads bidi (or luabidi) for RTL languages.

  • Thanks a lot! I also have another question, please: What is the correct practice for inserting math formulas in such a document? Should I insert a \begin{equation}..\end{equation} inside a english environment, and insert the inline math ($..$) inside a \textenglish{} command? Or rather inserting the math formulas just as they are?
    – tush
    Nov 11, 2021 at 18:29
  • Or, at least, inside a \LRE{} command?
    – tush
    Nov 11, 2021 at 19:56
  • Explicit language or direction switch should not be necessary, as bidi redefines math in order to deal with that (at least in theory).
    – JSpitzm
    Nov 12, 2021 at 7:35
  • @tush I suggest you accept this answer (click on the green checkmark) if it answered your question so we can get it out of the unanswered queue.
    – scottkosty
    Nov 13, 2021 at 20:39
  • @JSpitzm can you refer me where in the bidi (or polyglossia) documentation this claim of yours regarding the \LRE{} can be found?
    – tush
    Nov 16, 2021 at 17:47

You must log in to answer this question.

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