0

I am new to LaTeX and I just strated to use Polyglossia to write Hebrew documents. When I try to write text in italic, it just produces the same text style. For example

\documentclass{article}
\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setmainfont{David}

\begin{document}
שלום עולם

\textit{שלום עולם}
\end{document}

Produces:

enter image description here

How can I define italic-type for the font?

11
  • 1
    Maybe David does not have an italic variant (or you don't have it installed). Try David CLM from culmus.sourceforge.net Commented Mar 16, 2019 at 13:18
  • I downloaded it using this link: ma.huji.ac.il/~sameti/tex/culmusmiktex.html for Windows, but it doesn't seem to be working... When trying to write in italic variant it just says that the file is not found.David CLM exists, but its italic variant doesn't.
    – ABN263
    Commented Mar 16, 2019 at 19:07
  • Italics aren't really used in hebrew typesetting. Some people do letterspacing (which I suggest against). There is a way to fake it, though. You can use the AutoFakeSlant option with a negative number when you use the font. Although that's also arguably a bad idea.
    – A Gold Man
    Commented Mar 16, 2019 at 21:10
  • Make sure what you downloaded includes David CLM in OpenType format and it is installed as a system font so it appears in other applications (e.g., Word). Commented Mar 16, 2019 at 22:01
  • Actually, you definitely don't want that MikTeX download. I does not include any OpenType fonts, only formats for use with pdflatex. You want to download the latest release from SourceForge: sourceforge.net/projects/culmus/files/culmus/0.133 Commented Mar 16, 2019 at 22:11

2 Answers 2

1

Use a font that supports Hebrew italics, such as the Culmus fonts:

\documentclass[12pt]{article}
\usepackage[bidi=default, english]{babel}
\usepackage{fontspec}
\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]{Inconsolatazi4}
\babelfont[hebrew]{rm}[Language = Default]{David CLM}
\babelfont[hebrew]{sf}[Language = Default]{Miriam CLM}
\babelfont[hebrew]{tt}[Language = Default]{Miriam Mono CLM}

\begin{document}
שלום עולם

\textit{שלום עולם}
\end{document}

enter image description here

This particular font slants its italic face right-to-left. If you would rather slant left-to-right (matching the Latin script and many Israeli word processors), instead use FakeSlant. Here, I’ve defined this as the slanted font (\slshape or \textsl):

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

\babelprovide[import, main]{hebrew}

\defaultfontfeatures{ Ligatures = TeX, Scale = MatchUppercase }
\defaultfontfeatures[DavidCLM]{
  UprightFont = {*-Medium},
  BoldFont = {*-Bold},
  SlantedFont = {*-Medium},
  BoldSlantedFont = {*-Bold},
  SlantedFeatures = {FakeSlant = 0.15},
  Extension = {.otf}
}

\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]{Inconsolatazi4}
\babelfont[hebrew]{rm}[Language = Default]{DavidCLM}
\babelfont[hebrew]{sf}[Language = Default]{Miriam CLM}
\babelfont[hebrew]{tt}[Language = Default]{Miriam Mono CLM}

\begin{document}
שלום עולם

\textsl{שלום עולם}
\end{document}

David CLM sample

0

This works as it should on a stable Debian system - although I had to use \setmainfont{David CLM} instead of \setmainfont{David} (there is no David font available in Debian, only David CLM)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .