I suggest you to try XeLaTeX and Polyglossia; in my experience, installing full Hebrew for babel
has been painful. Not that I know any Hebrew, but I had to typeset some text in that language.
Here's an example. You may need to change the font name; what font to use depends on your operating system, but any OpenType or TrueType system font supporting Hebrew should be good. The \newfontfamily{\hebrewfont}{...}
may be needed or not, depending on how the font advertises its support for Hebrew.
The text has been taken from the page on Jerusalem in the Hebrew Wikipedia, http://he.wikipedia.org/wiki/ירושלים
If http://translate.google.com is not mistaken, the title should mean “Hello world”.
\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setmainfont{New Peninim MT}
\newfontfamily{\hebrewfont}{New Peninim MT}
\begin{document}
\title{שלום עולם}
\author{שלום עולם}
\maketitle
העיר מקודשת ליהדות, לנצרות ולאסלאם, והיוותה מרכז חיי העם היהודי בימי
קדם ומושא געגועיו בזמן שהייתו בגלות. משום מרכזיותה בעולמם של המאמינים,
הייתה העיר מוקד למלחמות וסכסוכים הנמשכים עד עצם היום הזה. מאז סוף המאה
ה-19 התפתחו סביב העיר העתיקה שכונות העיר החדשה, המהוות כיום את רובה
המוחלט של העיר. במרכזה של ירושלים השלמה עומד הר הבית, שמפריד בין מערב
ירושלים למזרח ירושלים.
בשנת 1981 הוכרזה העיר העתיקה של ירושלים כאתר מורשת עולמית על ידי ארגון
אונסק"ו של האומות המאוחדות, והיא נמצאת ברשימת האתרים בסיכון.
\end{document}
My understanding is that you have to tell polyglossia
what font to use for each language, and when you are using each language.
Blue is FreeSerif font set as \hebrewfont
.
By the time biblatex
/biber
reads the .bib file, the polyglossia
command in the .bib file is already established, because polyglossia
has been loaded before biblatex
.
The dummy bib ref is just a random snippet from the Wikipedia article on the solar system.
MWE
% !TeX TS-program = lualatex
\documentclass{article}[9pt]
\begin{filecontents*}[overwrite]{Midrash.bib}
@book{frenkelYvnymBvlmvHrvkhny1981a,
title = {\begin{hebrew}עיונים בעולמו הרוחני של סיפור האגדה\end{hebrew}.},
author = {Frenḳel, Yonah.},
date = {1981},
publisher = {{Hakibuts Hame'uḥad}},
location = {{Tel-Aviv}},
langid = {hebrew}
}
@book{מ,
title={\begin{hebrew}מערכת השמש\end{hebrew}},
author={\begin{hebrew}נפטון\end{hebrew}},
}
\end{filecontents*}
\usepackage{reledmac}
\usepackage{xcolor}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{wrapfig}
\setdefaultlanguage{italian}
\setotherlanguage{hebrew}
\setmainfont{Times New Roman}
\newfontfamily\hebrewfont{FreeSerif}[Script=Hebrew,Color=blue]
\usepackage[style=verbose-trad3, doi=false,
isbn=false,
url=false,
eprint=false,
backend=biber
]{biblatex}
\addbibresource{Midrash.bib}
\Xarrangement[A]{paragraph}
\begin{document}
\section{אבגד -- without environment}
\section{\begin{hebrew}אבגד \end{hebrew} -- with environment}
\begin{hebrew}אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת\end{hebrew}
See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ}
\printbibliography
\end{document}
I used biblatex
's \addbibresource
command, as well.
Addendum
Babel package
Lualatex can identify scripts by using Unicode algorithms, so explicit markup is not generally needed. (Multiple runs of different scripts diving in and out of the main script, like the Latin texts in the Hebrew-version bibliography, will need markup, for a tidier presentation.)
For a comparison of intermingled languages (ignoring runs), using babel
package compiled with lualatex to take advantage of this feature, with Italian as the main language:
MWE
\documentclass{article}[9pt]
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{frenkelYvnymBvlmvHrvkhny1981a,
title = {עיונים בעולמו הרוחני של סיפור האגדה.},
author = {Frenḳel, Yonah.},
date = {1981},
publisher = {{Hakibuts Hame'uḥad}},
location = {{Tel-Aviv}},
langid = {hebrew}
}
@book{מ,
title={מערכת השמש},
author={נפטון},
}
\end{filecontents*}
\usepackage{reledmac}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{fontspec}
\usepackage[italian,bidi=basic]{babel}%<--- main language
\usepackage[autostyle]{csquotes}
\babelfont{rm}{Noto Serif}
\babelfont{sf}{Noto Sans}
\babelfont{tt}{Noto Sans Mono}
\babelprovide[import, onchar=fonts ids]{hebrew}
\babelfont[hebrew]{rm}[Color=blue]{LiberationSerif}
%\makeatletter%workaround to satisfy biblatex parms - not needed
%\newtoggle{blx@lang@captions@english}
%\makeatother
\usepackage[style=verbose-trad3, doi=false,
isbn=false,
url=false,
eprint=false,
backend=biber
]{biblatex}
\addbibresource{\jobname.bib}
\Xarrangement[A]{paragraph}
\begin{document}
\section{אבגד}
אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת
The cat sat on the mat.
\section{הוז}
אבגד הוז the cat חטיך כלםמ ןנסע ףפץצ קרשת
See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ}
\printbibliography
\end{document}
and with Hebrew as the main language:
MWE
\documentclass{article}[9pt]
\begin{filecontents*}[overwrite]{\jobname.bib}
@book{frenkelYvnymBvlmvHrvkhny1981a,
title = {עיונים בעולמו הרוחני של סיפור האגדה.},
author = {Frenḳel, Yonah.},
date = {1981},
publisher = {{Hakibuts Hame'uḥad}},
location = {{Tel-Aviv}},
langid = {hebrew}
}
@book{מ,
title={מערכת השמש},
author={נפטון},
}
\end{filecontents*}
\usepackage{reledmac}
\usepackage{xcolor}
\usepackage{wrapfig}
\usepackage{fontspec}
\usepackage[bidi=basic]{babel}
\usepackage[autostyle]{csquotes}
\babelfont{rm}{Noto Serif}
\babelfont{sf}{Noto Sans}
\babelfont{tt}{Noto Sans Mono}
\babelprovide[import, main, onchar=fonts ids]{hebrew}%<-- main language
\babelfont[hebrew]{rm}[Color=blue]{LiberationSerif}
\makeatletter%workaround to satisfy biblatex parms
\newtoggle{blx@lang@captions@english}
\makeatother
\usepackage[style=verbose-trad3, doi=false,
isbn=false,
url=false,
eprint=false,
backend=biber
]{biblatex}
\addbibresource{\jobname.bib}
\Xarrangement[A]{paragraph}
\begin{document}
\section{אבגד}
אבגד הוז חטיך כלםמ ןנסע ףפץצ קרשת
The cat sat on the mat.
\section{הוז}
אבגד הוז the cat חטיך כלםמ ןנסע ףפץצ קרשת
See \cite{frenkelYvnymBvlmvHrvkhny1981a,מ}
\printbibliography
\end{document}
Best Answer
This is not an answer. I was able to produce the minimal working example as:
after runing
pdflatex
on this, you get exactly the same error message. I have also forwared this to Heiko Oberdiek and if he answers me, then I post his answer here but I think this actually seems to be a limitation of the pdfTeX engine with TeX--XeT algorithm (the algorithm already have many annoying bugs) and it may turn out that this is not even fixable. XeTeX and PDFTeX both uses TeX--XeT but hyperref with PDFTeX uses PDFTeX primitives for hypertext and in XeTeX, it uses\special
.Edit: This is verbatim response of Heiko Oberdiek:
I also asked him, why this problem happens with PDFTeX and not with XeTeX. Here is his response: