latex3 / babel

The babel system for LaTeX, LuaLaTeX and XeLaTeX
LaTeX Project Public License v1.3c
125 stars 34 forks source link

Wrong equation direction in first column in array and tabular environment (with bidi=basic option) #158

Closed seloumi closed 2 years ago

seloumi commented 2 years ago

With bidi=basic math in first column of tabular or array environments appears in reverse direction (from right to left) , If we include math of first column in \hbox we get a correct result. With bidi=basic-r option the result is fine.

\documentclass{article}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}

\begin{document}

\[
\begin{array}{cc}
ax+b &  f(x)=x^2-3 \\ %  \hbox{$ax+b$} &  f(x)=x^2-3 give correct result 
ax+b &  f(x)=x^2-3
\end{array}
\]%

\begin{tabular}{cc}
$ax+b$  &  $f(x)=x^2-3$ \\
$ax+b$  &  $f(x)=x^2-3$
\end{tabular}

\hrulefill

\selectlanguage{nil}

\[
\begin{array}{cc}
ax+b &  f(x)=x^2-3 \\
ax+b &  f(x)=x^2-3
\end{array}
\]%

\begin{tabular}{cc}
$ax+b$  &  $f(x)=x^2-3$ \\
$ax+b$  &  $f(x)=x^2-3$
\end{tabular}

\end{document}
seloumi commented 2 years ago

Removing this line give correct result https://github.com/latex3/babel/blob/f88bad9a03874f05acb82356197d44415726280a/babel.dtx#L9954