RE6: Lots of undefined control sequences when using Arabic Babel

Sam Carter sam.carter8 at aol.com
Sun May 12 21:44:39 CEST 2024


In your MWE, you use the translation when you are still in the English language. If you switch languages, you get your translated text:

```
% !TeX TS-program = lualatex
\documentclass{book}

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

\babelprovide[onchar=ids fonts]{arabic}
\babelfont{rm}{Crimson}
\babelfont[*arabic]{rm}{FreeSerif}

\DeclareTranslation{Arabic}{text}{ ﻓﺼﺤﻰ اﻟﻌﺼﺮ }

\begin{document}

\selectlanguage{arabic}

\GetTranslation{text}

\end{document}
```

> On 12. May 2024, at 21:26, outlook user <RACP at outlook.fr> wrote:
> 
> Running that code:
> 
> ```LaTeX
> \documentclass{book}
> 
> \usepackage{translations}
> \usepackage[english, bidi=basic]{babel}
> 
> \babelprovide[onchar=ids fonts]{arabic}
> \babelfont{rm}{Crimson}
> \babelfont[*arabic]{rm}{FreeSerif}
> 
> \DeclareTranslation{Arabic}{text}{ ﻓﺼﺤﻰ اﻟﻌﺼﺮ }
> 
> \begin{document}
> 
> \GetTranslation{text}
> 
> \end{document}
> ```
> 
> Produces that: <www.overleaf.com_project_64d8d3ea4e14d9b8f46185a1.png>
> Where it should output Arabic characters
> 
> > you have some other issue
> 
> That problem is reproducible, you can copy-paste the MWE to see it. So it's not about me having a problem
> 
> > can not read it
> 
> No need for it. I literally copied the Arabic characters from the example you sent me in my own MWE. It's only about being able to output those rather than understand them
> 
> >> you would have an error about missing fonts
> 
> > Package fontspec Warning: Font 'Crimson' is using the default features for language 'English'. That's usually fine, because many languages require no specific features, but if the output is not as expected, consider selecting another font.
> > Package fontspec Warning: Font 'FreeSerif' is using the default features for language 'Arabic'. That's usually fine, because many languages require no specific features, but if the output is not as expected, consider selecting another font.
> 
> No errors otherwise. Disappears if I delete `\babelfont{rm}{Crimson}\n\babelfont[*arabic]{rm}{FreeSerif}`
> 
> But it's not about that anyway, because if it was about font problem, there won't be "text" written. The engine would try to output Arabic and would output nothing because failing to do so. Here it outputs the tag without even trying to output it in Arabic
> 
> 
> De : David Carlisle <d.p.carlisle at gmail.com>
> Envoyé : dimanche 12 mai 2024 20:46
> À : outlook user <RACP at outlook.fr>
> Objet : Re: RE4: Lots of undefined control sequences when using Arabic Babel
>  
> 
> On Sun, 12 May 2024 at 17:12, outlook user <RACP at outlook.fr> wrote:
> That code creates the same case as
> 
> > `\usepackage{babel}` with or without `\babelprovide{arabic}` doesn't output any Arabic, only latin text [...]. In fact `babelprovide` doesn't change anything to the case here
> 
> Don't produce errors but no Arabic text outputed
> 
> The code posted produces
> 
> <image.png>If you are not seeing Arabic text you have some other issue I can't help, sorry I am no expert on Arabic, and can not read it.
> If you don't have the font installed you would have an error about missing fonts.
> 
> David
> 
> 
>  
> ```LaTeX
> \documentclass{book}
> 
> \usepackage{translations}
> \usepackage[english, bidi=basic]{babel}
> 
> \babelprovide[onchar=ids fonts]{arabic}
> \babelfont{rm}{Crimson}
> \babelfont[*arabic]{rm}{FreeSerif}
> 
> \DeclareTranslation{Arabic}{text}{ ﻓﺼﺤﻰ اﻟﻌﺼﺮ }
> 
> \begin{document}
> 
> \GetTranslation{text}
> 
> \end{document}
> ```
> ________________________________________
> De : David Carlisle <d.p.carlisle at gmail.com>
> Envoyé : dimanche 12 mai 2024 17:57
> À : outlook user <RACP at outlook.fr>
> Cc : texhax at tug.org <texhax at tug.org>
> Objet : Re: RE2: Lots of undefined control sequences when using Arabic Babel
>  
> 
> I do not read arabic, but see the babel manual for some arabic examples, eg the following (which requires lualatex)
> 
> \documentclass{book}
> \usepackage[english, bidi=basic]{babel}
> 
> \babelprovide[onchar=ids fonts]{arabic}
> 
> \babelfont{rm}{Crimson}
> \babelfont[*arabic]{rm}{FreeSerif}
> 
> \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}





More information about the texhax mailing list.