3

I try to write an abstract in Hebrew.

I use MikTeX2.9 and TeXnicCenter editor.

This is my MWE:

\documentclass[12pt]{article}
\usepackage[english,bidi=default]{babel} %bidi=default with xelatex
\babelprovide[import,main]{hebrew}

\babelfont{rm}[Language=Default]{Latin Modern Roman}
\babelfont[hebrew]{rm}{DejaVu Sans}
%\babelfont[hebrew]{rm}{Noto Sans Hebrew}

\begin{document}

\begin{center}
\Huge
\textbf{תקציר}
\end{center}

ניסוי ותהייה, או ניסוי וטעיה?

\selectlanguage{english} some text 

\end{document}

When I compile it with XeLaTeX I get no errors but 1 warning saying:

Package fontspec Warning: 'Language 'Hebrew' not available for font 'DejaVu Sans' with script 'Hebrew' 'Defualt' language used instead'

In the pdf generated I get question marks instead of the Hebrew letters.

I'll appreciate if someone can tell me step by step how to make the language Hebrew available for the font 'DejaVu Sans' with script Hebrew.

  • 1
    You can use \babelfont[hebrew]{rm}[Language=Default]{DejaVu Sans} to avoid the warning, but it is not the reason for the question marks. And better get it first working with lualatex -- its font handling is easier, it is less picky regarding the name and the log is better. – Ulrike Fischer Jan 30 '19 at 21:27
  • Less than 2 out of 3 Hebrew characters are available you need to check the ? are not in the missing 38% see en.wikipedia.org/wiki/DejaVu_fonts and dejavu-fonts.github.io – user170109 Jan 30 '19 at 21:38
2

I needed to remove the import option of \babelprovides to get the MWE to compile with Babel 3.22. Having done that, I can’t reproduce your bug:

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage[bidi=default, english]{babel}
\babelprovide[main]{hebrew}

\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\babelfont{rm}[Language=Default, Scale = 1.0]{DejaVu Serif}
\babelfont[hebrew]{rm}[Language = Default]{DejaVu Sans}

\begin{document}
\begin{minipage}{10cm} % To fit both RTL and LTR text inside a TeX.SX image.
\section*{תקציר}

ניסוי ותהייה, או ניסוי וטעיה?

\selectlanguage{english}
some text 
\end{minipage}
\end{document}

DejaVu Hebrew-English sample

Are you using a recent version of DejaVu Sans, and compiling with XeTeX? Version 2.37 of the font contained the glyphs I needed.

The “Language ‘Hebrew’ not available” warning was a red herring. It simply means that the font you selected does not declare that OpenType font feature. Supporting the Hebrew script matters a lot, because that’s needed for bidirectional text to work correctly, but the language feature would only matter if there were two languages using the Hebrew script that had different behavior. (For example, selecting the Turkish language changes the small-caps form of i to İ and the lowercase form of I to ı.)

You can suppress this harmless warning message the same way that you did for English: add [Language = Default] to the options of \babelfont.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.