bidi-tex / bidi

Bidirectional typesetting in plain TeX and LaTeX, using XeTeX
Other
3 stars 0 forks source link

Reversed parentheses in equation numbers #5

Closed jspitz closed 5 years ago

jspitz commented 5 years ago

According to several posts on stackexchange, bidi used to correct the panthesis direction in equation via amsmath-bidi-xetex.def (see https://tex.stackexchange.com/a/144980/19291). However, this seems to be broken (see MWE below).

The workaround given at https://tex.stackexchange.com/a/186047/19291 does not seem to work either (see commented code).

% !TEX TS-program = xelatex
\documentclass[a4paper, twoside, titlepage, 11pt]{report}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{polyglossia}
\setmainlanguage{hebrew}
\setotherlanguage{english}
\newfontfamily\hebrewfont[Script=Hebrew]{FreeSans}
% Uncommenting this does not help either
% See https://tex.stackexchange.com/a/186047/19291
%\csname @Latintrue\endcsname
\setmainfont{FreeSans}

\begin{document}

\begin{equation}
a=\frac{dx}{dt}
\end{equation}

\end{document}

Note that the direction is correct if the main language is LTR, but not if it is RTL.

reutenauer commented 5 years ago

The workaround that currently works is an easy variation on the fix that worked five years ago: \csname @nonlatintrue\endcsname. At least it does for me, can you please test?

jspitz commented 5 years ago

Yes, this works around it, indeed.

reutenauer commented 5 years ago

Shall we define that boolean in the Polyglossia language definition files for RTL languages then?

jspitz commented 5 years ago

I am not sure about the correct place for the fix. luabidi does not suffer from it, so it should go in \ifxetex. Also it seems that the command we should use would be rather \setnonlatin (which sets that switch to true). Alas, this seems to be not documented at all, so I have no idea about possible effects.

seloumi commented 5 years ago

\csname @nonlatintrue\endcsname (\setnonlatin) solve also polyglossia issue #213 without need to redefine \arabicnumber image

reutenauer commented 5 years ago

Thank you @seloumi, that’s very helpful (@jspitz that’s from bidi-doc.pdf in case you wonder).

jspitz commented 5 years ago

I see. So we should revert my fixes to reutenauer/polyglossia#213 and use \setnonlatin in the extras of RTL languages and \setlatin in the nonextras.

I am currently busy with real work, though.

jspitz commented 5 years ago

I see. So we should revert my fixes to reutenauer/polyglossia#213

This part is done.

jspitz commented 5 years ago

Fixed in polyglossia with the referenced commit.