user-is-inactive-forever / xepersian

Persian for LaTeX, using XeTeX
https://ctan.org/pkg/xepersian
5 stars 1 forks source link

siunitx package is incompatible with bidi / XePersian #4

Open ImanBayat opened 5 years ago

ImanBayat commented 5 years ago

Brief outline of the issue

It seems siunitx package is not compatible xepersian package. The decimal point does not change to the Persian decimal separator i.e. momayyez in \SI or \num sequences. Also \SIlist and \SIrange sequences have incorrect direction and should change words "and" and "to" into proper equivalents. Finally, xepersian package eliminates the degree symbol ° even in the latin environment.

Check/indicate

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode

\documentclass{article}
\usepackage{siunitx}
%\sisetup{detect-mode}  %detect-all

\usepackage{xepersian}
\settextfont{Yas}
\setmathdigitfont{Yas}

%\usepackage{fontspec}
%\setmainfont[Script=Arabic]{Yas}
%\usepackage{bidi}

\DeclareSIUnit{\calorie}{cal}
\begin{document}
یک کالری کوچک تقریباً برابر است با $4.2$ ژول (به‌طور دقیق $4.1868$ ژول)

\[\SI{1}{\calorie} = \SI{4.1868}{\joule}\]

\SIlist{0.13;0.67;0.80}{\milli\metre}

\SIrange{0.13}{0.67}{\milli\metre}

\num{3.45d-4} 

\ang{4,5} 

\ang{1;2;3} $\ang{1;2;3}$

\begin{latin}
\[\SI{1}{\calorie} = \SI{4.1868}{\joule}\]

\SIlist{0.13;0.67;0.80}{\milli\metre}

\SIrange{0.13}{0.67}{\milli\metre}

\num{3.45d-4} 

\ang{4,5} Where is the $^{\circ}$ (degree) symbol?!

\ang{1;2;3} $\ang{1;2;3}$

\end{latin}
\end{document}

Expected behavior

Log and PDF files

siunitx.MWE.log siunitx.MWE.pdf