I found some threads in tex.stackexchange about the possibility of writing in Hebrew with Latex (what, however, I already made with fontspec and polyglossia). The answers are an alternative: either fontspec + polyglossia or babel + utf8x. Now, referring to this problem (Xetex support for .otf features), one finds oneself consequently in the (unlikely?) situation of using babel with fontspec. Is it possible to write very short text or single words in Hebrew in this last situation? Or are they incompatible?
Adding a MWE
\documentclass[a4paper]{article}
\usepackage{fontspec}
\usepackage[hebrew,greek,italian]{babel}
\languageattribute{greek}{ancient}
\babelfont[greek,italian]{rm}[Ligatures=TeX,Numbers={Proportional,OldStyle}]{Garamond Premier Pro}
\babelfont[hebrew]{rm}[Ligatures=TeX]{Ezra SIL SR}
%\babelfont[italian]{rm}[Language=Default,Ligatures=TeX,Numbers={Proportional,OldStyle}]{<nome_font>}
%\babelfont[english]{rm}[Language=English,Ligatures=TeX,Numbers={Proportional,OldStyle}]{<nome_font>}
%\babelfont{rm}[Ligatures=TeX]{Ezra SIL SR}
\begin{document }
Dopo il passo ove Dio porta a termine l'opera, è collocata una sezione di fonte
jahvista, così chiamata dal nome usato per indicare Dio, anche se qui, precisamente,
vengono usati entrambi i nomi: infatti la denominazione attribuita alla divinità
nel versetto 2,4b suona \selectlanguage{hebrew}אֱלֹהִים יְהוָה \selectlanguage{italian}
(\emph{jahvè 'elohim}, tradotto diffusamente come «il Signore Dio»\footnote{I
Settanta rendono l'espressione con \selectlanguage{greek}κύριος ὀ ϑεός
\selectlanguage{italian} e la Vulgata con \emph{Dominus Deus}.}), poiché
l'originaria fonte jahvista è stata fusa a quella elohista nella redazione
sacerdotale, che mantiene il nome di Jahvé, ma aggiunge il proprio e cioè 'Elohim.
\end{document}
And this is output:
samiel@darkstar:~$ xelatex text.tex
This is XeTeX, Version 3.14159265-2.6-0.99999 (TeX Live 2018) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./text.tex
LaTeX2e <2018-12-01>
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/local/texlive/2018/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def)))
(/usr/local/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/tuenc.def))
(/usr/local/texlive/2018/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/babel.sty
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/switch.def)
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel-hebrew/rlbabel.def)
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel-hebrew/hebrew.ldf
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/babel.def
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/xebabel.def
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel/txtbabel.def)))
Package babel Warning: No hyphenation patterns were preloaded for
(babel) the language `Hebrew' into the format.
(babel) Please, configure your TeX system to add them and
(babel) rebuild the format. Now I will use the patterns
(babel) preloaded for english instead on input line 57.
) (/usr/local/texlive/2018/texmf-dist/tex/generic/babel-greek/greek.ldf
(/usr/local/texlive/2018/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def
(/usr/local/texlive/2018/texmf-dist/tex/latex/greek-fontenc/greek-fontenc.def))
) (/usr/local/texlive/2018/texmf-dist/tex/generic/babel-italian/italian.ldf))
(/usr/local/texlive/2018/texmf-dist/tex/generic/babel-hebrew/lheenc.def)
(/usr/local/texlive/2018/texmf-dist/tex/latex/base/inputenc.sty
! Package inputenc Error: inputenc is not designed for xetex or luatex.
(inputenc) only UTF-8 supported.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.165 \endinput
SECOND VERSION
Following your direction, I tried this code:
\documentclass{article}
\usepackage{fontspec}
\usepackage[bidi=default]{babel}
\babelprovide[import=it,main]{italian}
\babelprovide[import=el]{greek}
\babelprovide[import=he]{hebrew}
\babelfont[italian]{rm}[Ligatures=TeX,Numbers={Proportional,OldStyle}]{Garamond Premier Pro}
\babelfont[greek]{rm}[Ligatures=TeX]{Garamond Premier Pro}
\babelfont[hebrew]{rm}[Ligatures=TeX]{Ezra SIL SR}
\begin{document}
Dopo il passo ove Dio porta a termine l'opera, è collocata una sezione di fonte
jahvista, così chiamata dal nome usato per indicare Dio, anche se qui, precisamente,
vengono usati entrambi i nomi: infatti la denominazione attribuita alla divinità
nel versetto 2,4b suona \selectlanguage{hebrew}אֱלֹהִים יְהוָה \selectlanguage{italian}
(\emph{jahvè 'elohim}, tradotto diffusamente come «il Signore Dio»\footnote{I
Settanta rendono l'espressione con \selectlanguage{greek}κύριος ὀ ϑεός
\selectlanguage{italian} e la Vulgata con \emph{Dominus Deus}.}), poiché
l'originaria fonte jahvista è stata fusa a quella elohista nella redazione
sacerdotale, che mantiene il nome di Jahvé, ma aggiunge il proprio e cioè 'Elohim.
\end{document}
However, if I compile with XeTeX I receive this warning:
! Package babel Error: Multiple bidi settings inside a group
and compilation fails. On the contrary, if I compile with LuaTeX all seems to work fine. All's well that ends well for I have my pdf, but is this different behavior between XeTeX and LuaTeX normal?
babel
really needslualatex
for best outcomes with RTL languages though, but you can do really cool things now. Look through all the bidi stuff in thebabel
manual.)gloss-hebrew.ldf
file has a warning that says LuaTeX is not supported though. I assume this is ignorable now?babel
(with xelatex and lualatex) does not useldf
files. Instead everything is defined inbabel-he.ini
and included using the\babelprovide
command. In my view trying to use Hebrew withpdflatex
is not worth the pain.