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

2023-09-10 Thread Javier Bezos




According to documentation it seems to me that ucharclasses work only
with XeLaTeX. 


But with babel and lualatex you can switch the font depending
on the script, even with RTL ones, which, if things haven’t
changed, isn’t possible with ucharclasses. See the examples
in p. 44 of the babel manual.

Javier



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

2023-09-10 Thread Javier Bezos

> According to documentation it seems to me that ucharclasses work only
> with XeLaTeX.

But with babel and lualatex you can switch the font depending
on the script, even with RTL ones, which, if things haven’t
changed, isn’t possible with ucharclasses. See the examples
in p. 44 of the babel manual.

Javier


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

2023-09-10 Thread Zdenek Wagner
ne 10. 9. 2023 v 15:21 odesílatel Javier Bezos  napsal:
>
>
> > According to documentation it seems to me that ucharclasses work only
> > with XeLaTeX.
>
> But with babel and lualatex you can switch the font depending
> on the script, even with RTL ones, which, if things haven’t
> changed, isn’t possible with ucharclasses. See the examples
> in p. 44 of the babel manual.
>
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.

> Javier
>

Zdeněk Wagner
https://www.zdenek-wagner.eu/



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

2023-09-10 Thread Javier Bezos




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:


\documentclass{book}

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

\babelprovide[onchar=ids fonts]{arabic}

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

\begin{document}

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).

\end{document}


Javier