4

I need to write an abstract in Hebrew.

With help I managed to get the next MWE to work (I use LuaLaTeX):

\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}[Language=Default]{DejaVu Sans}
%\babelfont[hebrew]{rm}[Language=Default]{David} -Not Working: Does not contain script Hebrew
%\babelfont[hebrew]{rm}[Language=Default]{DejaVu Serif}-Not Working: Does not contain script Hebrew

%\babelfont[hebrew]{rm}{Noto Sans Hebrew}

\usepackage{setspace}
\setlength\headheight{15pt}
\usepackage[a4paper,top=25mm,bottom=20mm,outer=2.5cm,inner=4cm]{geometry}
\pagenumbering{gobble}

\begin{document}
\doublespacing

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

\end{document}

However, the font looks like an 'Arial' font: ~'Arial' font while I need it to look like a 'David' font: ~'David' font

I do not know how to find the right font that won't produce errors. I am a real novice regarding all the TeX technicalities.

Simply changing 'DejaVu Sans' to 'David' produced a warning that Font 'David' does not contain script 'Hebrew', and the generated pdf showed wierd symbols instead of the Hebrew letters.

Can someone please give a step by step explanation how to get the right font working?

  • 1
    The command fc-list :lang=he should return a list of fonts already installed that support Hebrew. Take a look at them before searching for new fonts to install, because you may already have what you need. – Thérèse Jan 31 at 18:14
  • @Therese : Where do I type this command? ( I'm using MikTeX2.9 and TeXnicCenter editor. ) – user4861528 Jan 31 at 18:23
  • 1
    Oh dear. I don’t use Microsoft. You need a terminal or some window whose purpose is entering command lines. No idea where Microsoft hides those things. – Thérèse Jan 31 at 18:27
  • @Therese : When I put this command in Windows command line I get the message: 'fc-list' is not recognized as an internal or external command, operable program, or batch file.' Is it a command of unix/linux OS only? – user4861528 Jan 31 at 18:46
  • 1
    in miktex fc-list is called miktex-fc-list. – Ulrike Fischer Jan 31 at 19:31
6

There are a few different free versions of David on the Web. A good resource is the Open Siddur project. Here, I use David CLM from the Culmus project, but you might also try David Libre. For the matching English font, I picked TeX Gyre Bonum, a clone of Bookman.

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

\babelprovide[import, main]{hebrew}

\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\babelfont{rm}[Scale = 1.0, Ligatures = Common, Language = Default]{TeX Gyre Bonum}
\babelfont{sf}[Ligatures = Common, Language = Default]{TeX Gyre Heros}
\babelfont{tt}[Language = Default]{Inconsolata}
\babelfont[hebrew]{rm}[Language = Default]{David CLM}
\babelfont[hebrew]{sf}[Language = Default]{Miriam CLM}
\babelfont[hebrew]{tt}[Language = Default]{Miriam Mono CLM}

% This prevents the minipage environment from suppressing the space between
% paragraphs.  You could also save \parindent to keep paragraph indentation, but
% this example alternates right-to-left and left-to-right paragraphs.
\makeatletter
\newlength\savedparskip
\setlength\savedparskip{\parskip}
\newcommand{\@minipagerestore}{\setlength{\parskip}{\savedparskip}}
\makeatother

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

ניסוי ותהייה, או ניסוי וטעיה?
\foreignlanguage{english}{(We shall see.)}

\begin{otherlanguage}{english}
some text \foreignlanguage{Hebrew}{בעברית}
\end{otherlanguage}
\end{minipage}
\end{document}

David CLM/Bonum font sample

Here is an alternative with David Libre and polyglossia. It falls back on David CLM for the italic styles. It also demonstrates how to set Hebrew sans-serif and monospace fonts.

\documentclass[12pt]{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{parskip}

\setdefaultlanguage{hebrew}
\setotherlanguage{english}

\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\setmainfont{TeX Gyre Pagella}[
  Scale = 1.0 ,
  Numbers = OldStyle ,
  Ligatures = {Common, Discretionary}]
%\setsansfont{URWClassico}[
%  UprightFont = *-Regular ,
%  ItalicFont = *-Italic ,
%  BoldFont = *-Bold ,
%  BoldItalicFont = *-BoldItalic ,
%  Extension = .otf ]
%\setmonofont{Inconsolata}
\newfontfamily\hebrewfont{David Libre}[
  Script = Hebrew ,
  Language = Hebrew ,
  UprightFeatures = { Ligatures = {Common, Discretionary} } ,
  BoldFeatures = { Ligatures = {Common, Discretionary} } ,
  ItalicFont = [DavidCLM-MediumItalic] ,
  BoldItalicFont = [DavidCLM-BoldItalic] ]
%\newfontfamily\hebrewfontsf{Miriam Libre}[
%  Script = Hebrew ,
%  Ligatures = Common ]
%\newfontfamily\hebrewfonttt{Miriam Mono CLM}[
%  Script = Hebrew]

% This prevents the minipage environment from suppressing the space between
% paragraphs.  You could also save \parindent to keep paragraph indentation, but
% this example alternates right-to-left and left-to-right paragraphs.
\makeatletter
\newlength\savedparskip
\setlength\savedparskip{\parskip}
\newcommand{\@minipagerestore}{\setlength{\parskip}{\savedparskip}}
\makeatother

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

ניסוי ותהייה, או ניסוי וטעיה?
\textenglish{(We shall see.)}

\begin{english}
some text \texthebrew{בעברית}
\end{english}
\end{minipage}
\end{document}

David Libre/TeX Gyre Pagella sample

I find David Libre to be a good match for Palatino (and hence its clone Pagella) and Miriam Libre to be a good match for Optima (and hence its clone Classico). Personally, I prefer this combination of fonts.

If you need to mix italic fonts in both languages, one consideration is that many Hebrew oblique fonts are slanted the opposite direction from other fonts. (Or you might use a Hebrew oblique with left-to-right slant, or Drugulin for emphasis instead.) This can particularly bite you in math theorems. Therefore, you might consider loading \usepackage[math-style = upright]{unicode-math} if you would otherwise be mixing slants in opposite directions. One of the rare math fonts designed with upright letters is Hermann Zapf’s Euler.

  • 1
    Using hebrew with babel works fine if you use the import method (which will not load the outdated ldf), and babel is much better maintained as polyglossia. – Ulrike Fischer Jan 31 at 22:38
  • Works fine here (both with current texlive2018 and miktex on windows). Is your babel up-to-date? – Ulrike Fischer Jan 31 at 22:47
  • the current version is 2018/11/13 3.27. – Ulrike Fischer Jan 31 at 22:52
  • @UlrikeFischer Thanks, that was the problem. It works now. Will update. – Davislor Jan 31 at 23:10

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.