Using babel package and setting babelfont

Ehud via lyx-users <[email protected]> Mon, 12 Jan 2026 15:08:53 +0000
Newsgroups gmane.editors.lyx.general
Message-ID <[email protected]>
I want to have the following preamble for my document:
```
\documentclass{book}
\usepackage{fontspec}
\usepackage[english,hebrew,provide=*,bidi=default]{babel}
\babelfont[hebrew]{rm}[Script=Hebrew]{Arial}
\begin{document}

```
1. LyX doesn't allow the user to insert the babelfont macro AFTER the uspackage{babel} macro, so in Document Settings->LaTeX Preamble, I added the babelfont macro with AtBeginDocument:
```
\AtBeginDocument{
\babelfont[hebrew]{rm}[Script=Hebrew]{Arial}
}

```
but I tend to think that at the moment `AtBeginDocument` is defined, babel has not yet been loaded because of the way babel is built and implemented.
2. LyX doesn't allow to pass to babel the provide and bidi options that way, so I think that adding them to documentclass options is ok:
Document Settings->Document Class->custom-> add in this field `provide=*,bidi=default`.
But I would like to verify whether this is correct as I haven't seen in the babel manual that passing babel options to document class is correct.

Any ideas for how I can use the babelfont macro(s) in my LyX document?

-- 
lyx-users mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-users