3

I am using XeLaTeX + polyglossia for Hebrew typesetting. Recently I have encountered an issue with producing dashes (Kav Mafrid, in Hebrew) in Hebrew texts. The issue arises when I am using newfontfamily instead of setmainfont.

To be more precise, here is an example. When I am using setmainfont, the following code

\documentclass{article}
\usepackage{fontspec}
\setmainfont{David CLM}
\setsansfont{Simple CLM}
\setmonofont{Miriam Mono CLM}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\begin{document}
קו -- מפריד.
\end{document}

produces the right output:

kav mafrid - ok

However, the compilation in that case is very slow (I have no idea why, but it runs xelatex 6 times), and I have issues including Latin characters with accents inside Hebrew paragraphs (see this question).

The better practice is, perhaps, to use newfontfamily. In that case, this is the code:

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Simple CLM}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\begin{document}
קו -- מפריד.
\end{document}

In that case, the compilation is very quick (only a single call to xelatex), and some issues with Latin characters are solved, but the output is the following:

kav mafrid - wrong

Any idea what I can do to fix this behaviour?

1 Answer 1

4

Just add Ligatures=TeX to your fontfamily options.

3
  • Ligatures=TeX is enabled by default with recent versions of fontspec.
    – egreg
    Commented Dec 18, 2015 at 12:49
  • I have added \defaultfontfeatures{Ligatures=TeX} just after loading fontspec, and it did the job. Thanks!
    – Bach
    Commented Dec 18, 2015 at 12:50
  • @egreg I'm using the most recent version, and it doesn't do that with Bach's MWE.
    – Alan Munn
    Commented Dec 18, 2015 at 12:55

You must log in to answer this question.

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