[XeTeX] xetex crash: interaction between interchar and linebreaklocale mechanisms

Javier Bezos jbezos.lists at gmail.com
Sun Sep 10 18:04:41 CEST 2023

> I can do the same with polyglossia both with xelatex and lualatex but
> imagine that I am writing a document in Hindi and from time to time it
> contains a single word in English, Russian, Urdu, Gujarati and it may
> be loaded from another file. I just do not want to write \textenglish,
> \textrussian, \texturdu, \textgujarati. With RTL inside LTR
> ucharclasses works for single words, with two or more words it will be
> wrong.

My point is with babel + LuaTeX you don’t need any macro
to switch the font, the text direction and the line breaking
rules, which is what you want. Things like \textenglish,
\textrussian, \texturdu, \textgujarati, etc., are not
necessary for a few words and short texts, even if the
script is RTL. The example in the babel manual is:


\usepackage[english, bidi=basic]{babel}

\babelprovide[onchar=ids fonts]{arabic}

\babelfont{rm}{Crimson} % Main font
\babelfont[*arabic]{rm}{FreeSerif} % Font for the Arabic script


Most Arabic speakers consider the two varieties to be two registers
of one language, although the two registers can be referred to in
Arabic as فصحى العصر \textit{fuṣḥā l-ʻaṣr} (MSA) and
فصحى التراث \textit{fuṣḥā t-turāth} (CA).



More information about the XeTeX mailing list.