1

I have an issue with xelatex+bidi where parentheses sometimes are reversed on multilingual lines. A minimal example is included:

\documentclass{article}

\usepackage{polyglossia}
\usepackage{bidi}

\setdefaultlanguage[calendar=hebrew]{hebrew}
\newfontfamily\hebrewfont[Script=Hebrew,Scale=1]{Times New Roman}

\renewcommand{\labelenumi}{\arabic{enumi})}


\begin{document}

רשימה:
\begin{enumerate}
\item
סעיף שנגמר עם עברית.

\item
$1\neq 2$.

\item
בסעיף העוקב רואים בעיה.
\end{enumerate}

משפט בעברית (עם הערה שנגמרת ב- English).

\end{document}

reversed parenthesis

Note how the 2nd item ending with a math environment 'switched' the context to English, so that the next item has its label parenthesis reversed. The same occurs when a closing parenthesis is preceded by English text.

Questions here and here claim that adding Script=Hebrew in my \hebrewfont should've fixed the issue, but it doesn't. Also, I've seen an indication that this issue might be related to polyglossia and the \if@Latin boolean, but I'm not sure how to fix that systemically.

closed as unclear what you're asking by Andrew Swann, Zarko, Stefan Pinnow, Jagath, Troy Aug 1 '17 at 16:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    This seems to be font related. If I run your document with David CLM the enumeration is correct. (My version of Times New Roman doesn't seem to have Hebrew, so I can't test with that.) Also, you need to set the other language to English and then wrap the English part in \textenglish{} to get the parentheses right in the last sentence. – Alan Munn Nov 1 '16 at 20:52
  • This seems to work fine on texlive 2017 on a mac. Perhaps a bug has been fixed in the meantime. – Andrew Swann Aug 1 '17 at 13:40
  • @AndrewSwann does it? Using vanilla texlive 2017 (XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017)) on Ubuntu Xenial I still get the reversed parenthesis on the following list item after an item concluding in English text (or inline math mode). However, as AlanMunn said, changing font to David CLM does take care of that. Also, his remark regarding adding \setotherlanguage{english} to the preamble and enclosing English text in \textenglish{} solves the problem demonstrated after the list. – Jonathan Y. Aug 1 '17 at 13:54
  • That seems to be further confirmation that it is some font issue. – Andrew Swann Aug 1 '17 at 14:26
  • My thoughts exactly. – Jonathan Y. Aug 1 '17 at 14:27