4

This is a problem I have for many years now, maybe you can help me solve it. I use the latest version of polyglossia (v1.50a), fontspec (v2.7i) and xetex (3.14159265-2.6-0.999992 (TeX Live 2020)).

For every Hebrew string I typeset, I get a parasitic blank space. I don't have the same problem with Arabic.

Here is a minimal example with only freely-available (and technically solid) fonts:

\documentclass{book}
\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage[variant=usmax]{english}%
\setotherlanguage{hebrew}
\setotherlanguage[calendar=gregorian,hijricorrection=1,locale=mashriq]{arabic}
\newfontfamily{\hebrewfont}[Script=Hebrew,Extension=.ttf,Scale=1.2]{Tinos-Regular}
\newfontfamily{\arabicfont}[Script=Arabic,Extension=.ttf,Scale=1.2]{Amiri-Regular}
\begin{document}
Bla bla “\texthebrew{הכתובת הדו-לשונית (יוונית-ארמית) םארמאזי}” blabla.

Bla bla “\textarabic{أمين معلوف، الهويّات القاتلة، دار الفارابي، ترجمة نهلة بيضون}” blabla.
\end{document}

Both Tinos and Amiri can be fetched from Google. Here is what I get (with the red arrow showing the parasitic space):

enter image description here

Notice that I also get a compilation error:

(/usr/local/texlive/2020/texmf-dist/tex/xelatex/bidi/latex-xetex-bidi.def

! LaTeX Error: Command \XeTeX already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.139 ...di@reflect@box{E}}\kern-.1667em \TeX}}$}}
                                                  
? 

! LaTeX Error: Command \XeLaTeX already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.141 ...@reflect@box{E}}\kern-.1667em \LaTeX}}$}}
                                                  
? 

Do you know some way to avoid this parasitic blank space? Or maybe I'm doing something wrong?

1 Answer 1

7

Don't use the xltxtra package, it is outdated (and gives your error).

The space is a bug which has been already reported: https://github.com/reutenauer/polyglossia/issues/459

Until polyglossia is updated you can hide the space like this:

\documentclass{book}
\usepackage{fontspec}
\usepackage{polyglossia}
\setdefaultlanguage[variant=usmax]{english}%
\setotherlanguage{hebrew}
\makeatletter\def\hebrew@ltr@numbers{%
    \ifxetex
       % Bidi inserts an RTL mark (0x200f) between number and number separator (- .),
       % forcing numbers to RTL. This is wrong for Hebrew.
       % So we defunc the respective command.
       \renewcommand*{\DigitsDotDashInterCharToks}{}%<----
    \fi%
}
\makeatother
\setotherlanguage[calendar=gregorian,hijricorrection=1,locale=mashriq]{arabic}
\newfontfamily{\hebrewfont}[Script=Hebrew,Extension=.ttf,Scale=1.2]{Tinos-Regular}
\newfontfamily{\arabicfont}[Script=Arabic,Extension=.ttf,Scale=1.2]{Amiri-Regular}
\begin{document}
Bla bla “\texthebrew{הכתובת הדו-לשונית (יוונית-ארמית) םארמאזי}” blabla.

Bla bla “\textarabic{أمين معلوف، الهويّات القاتلة، دار الفارابي، ترجمة نهلة بيضون}” blabla.
\end{document}
2
  • The problem is solved indeed, thank you Ulrike. How can I get informed when polyglossia is updated?
    – yannis
    Dec 2, 2020 at 21:15
  • If you have a GitHub account, you can subscribe to the issue on the right of it's page under "Notifications". Dec 4, 2020 at 10:17

You must log in to answer this question.

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