seloumi / beamer-rl

Right to left beamer presentations using babel (lualatex engine)
6 stars 1 forks source link

Wrong equation direction in `array` and `cases` environment #4

Closed jalilsadati closed 2 years ago

jalilsadati commented 2 years ago

in array and cases math environment text direction change to RTL. for example compare these two equations:

\documentclass[babel={layout=lists}]{beamer-rl}
\babelprovide[import,main,mapdigits]{arabic}
\begin{document}
\begin{frame}
\[
|x|=\left\{
\begin{array}{ll}
    1-x\frac{1}{\kappa} &  x>0 \\
    -x^2 & x<0
\end{array}
\right.
\]%

{\selectlanguage{nil}%

  \[
|x|=\left\{
\begin{array}{ll}
1-x\frac{1}{\kappa} &  x>0 \\
-x^2 & x<0
\end{array}
\right.
\]%
}
\end{frame}
\end{document}
seloumi commented 2 years ago

The bug come frombabel package (bidi=basic option), I will send a message to babel package maintainer

The bug appears in the first column of array or tabular environment (mathmode)

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

\begin{document}

\[
\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}

\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}
jalilsadati commented 2 years ago

Thanks