3

I've noticed that the way polyglossia renders alphabetical numerals is affected by the default language in a way that I believe it shouldn't.

Case in point, when I set Hebrew as the default language, \alph{counter} always renders as Hebrew-numeral, even within English blocks. Vice versa, polyglossia does recognize Hebrew blocks (when English is default) and renders their numerals accordingly.

A minimal working example follows:

\documentclass{article}
\usepackage{polyglossia}

\setmainlanguage{english}
\setotherlanguage{hebrew}

\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\englishfont{Times New Roman}

\begin{document}
\newcounter{counter}
\setcounter{counter}{5}

\begin{english}
A number: \alph{counter}
\end{english}

\begin{hebrew}
מספר בעברית:
\alph{counter}
\end{hebrew}

\end{document}

When I make English the default language (as above), the code renders as you might expect: Default-English

However, if Hebrew is made the default (switch main and other languages), I get the following problem (note the numeral in the English block is styled as a Hebrew numeral): Default-Hebrew

Is this a bug, or did I misunderstand how polyglossia is supposed to work?

2

1 Answer 1

4

Imho it is a bug. You could report it: https://github.com/reutenauer/polyglossia

As a workaround you can reset the number command:

\documentclass{article}
\usepackage{polyglossia}

\setotherlanguage{english}
\setmainlanguage{hebrew}

\newfontfamily\hebrewfont[Script=Hebrew]{Arial Unicode MS}
\newfontfamily\englishfont{Times New Roman}
\makeatletter
\hebrew@numbers 
\gappto\noextras@hebrew{\let\@alph\@origalph}
\makeatother

\begin{document}
\newcounter{counter}
\setcounter{counter}{5}
\alph{counter}

\begin{english}
A number: \alph{counter}
\end{english}

\begin{hebrew}
מספר בעברית:
\alph{counter}
\end{hebrew}

\end{document}

enter image description here

3
  • Curious; this solves the issue when Hebrew is set as default, but instead creates a problem when English is (same exact issue: Hebrew numerals everywhere). Is that to be expected (my Tex is lacking...)? Dec 18, 2017 at 12:24
  • 1
    Yes, with \hebrew@numbers hebrew numbers are activated, so you would need a similar setting in noextras@english to get rid of them. The whole thing would need a debugging. But as my old bug reports are not handled I don't want to waste my time to add more to the polyglossia tracker. Dec 18, 2017 at 12:27
  • Roger. If nobody has anything to add I'll accept this as the answer. Dec 18, 2017 at 12:33

You must log in to answer this question.

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