2

[enter image description here]For the shown MWE, some words ( some of them are indicated in the code since most of the community is not familiar with Arabic) do not appear correctly, where some letters are reversed to be placed instead of others. The word still maintains all its letters but letter arrangement is changed.

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,margin=2.5cm,bindingoffset=0.5cm]{geometry} 

\usepackage[hidelinks,colorlinks=true,breaklinks,allcolors=blue]{hyperref} 

\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}

\babelfont{rm}{Latin Modern Roman}
\babelfont[arabic]{rm}{amiri}
\babelfont[english]{rm}{Times New Roman}

\usepackage[table]{xcolor} 
\usepackage{tabu,multirow} 
\usepackage{array} 
\newcolumntype{?}[1]{!{\vrule width #1}} 
\usepackage{booktabs}
\setlength{\belowrulesep}{0pt}
\setlength{\belowbottomsep}{0pt}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\abovetopsep}{0pt}
\usepackage{makecell} 
\usepackage{boldline} 

\title{jhhjjhhj}
\author{}
\date{}

\begin{document}

\chapter{شكر وتقدير} 


\begin{table}[htbp]
\setlength\arrayrulewidth{1pt} 
\begin{center}
\caption{أمثلة لبعض الكلمات المتشابهة باللغات الناقلة}
\rowcolors{2}{white}{gray!25}
\begin{tabular}{?{1mm}c|c|c|>{\centering\arraybackslash}m{5cm}?{1mm}c|} 

% the word (مَلاخيمْ) does not apear correctly
مُلُوكْ & مَلاخيمْ  & الحروف والمعنى & -\\
\hline
نَفْسي & نَفْشِيْ   & الحروف والمعنى & -\\
\bottomrule[1mm] 
\end{tabular}
\label{tab}
\end{center}
\end{table}
\end{document}

enter image description here

  • You should mention how you compile - that's important with bidi. And you should show the output so that everyone can check if they get the same. – Ulrike Fischer Sep 21 '19 at 17:54
  • I compile using LUALATEX – Silva Sep 21 '19 at 17:55
  • @Ulrike, I added an image for the compilation output – Silva Sep 21 '19 at 18:01
  • 1
    Sorry I don't have your font. Try to make an example with Amiri. And reduce the size of the tabular to one row if possible - that is easier for someone not familiar with the script, – Ulrike Fischer Sep 21 '19 at 19:00
  • A minimal example showing the bug with option table package xcolor \documentclass[12pt]{book} \usepackage[table]{xcolor} \usepackage[bidi=basic,layout=lists]{babel} \babelprovide[import=ar,mapdigits,main]{arabic} \babelfont{rm}{Amiri} \begin{document} \begin{tabular}{c} اللغة\\ \end{tabular} \end{document} – Salim Bou Sep 21 '19 at 20:23
2

I think this is a bug with xcolor option table same issue with colortbl, the problem appear with r c l column type when using Amiri font

Apparently the issue is related to this \unhbox of arabic text cause an uncorrect result and can be solved with Javier Bezos answer

\documentclass[12pt]{book}
\usepackage[table]{xcolor}% or \usepackage{colortbl} 
\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelfont{rm}{Amiri}

\babelcharproperty{980000}[990000]{direction}{al}    

\begin{document}
\Huge
\begin{tabular}{c} 
اللغة العربية  \\  
\end{tabular}

\end{document}

And your example become

\documentclass[a4paper,12pt,twoside]{book}
\usepackage[a4paper,top=2.5cm,bottom=2.5cm,margin=2.5cm,bindingoffset=0.5cm]{geometry} 

\usepackage[hidelinks,colorlinks=true,breaklinks,allcolors=blue]{hyperref} 

\usepackage[bidi=basic,layout=lists.tabular]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}

\babelfont{rm}{Latin Modern Roman}
\babelfont[arabic]{rm}{amiri}
\babelfont[english]{rm}{Times New Roman}

\usepackage[table]{xcolor} 
\usepackage{tabu,multirow} 
\usepackage{array} 
\usepackage{booktabs}
\setlength{\belowrulesep}{0pt}
\setlength{\belowbottomsep}{0pt}
\setlength{\aboverulesep}{0pt}
\setlength{\belowrulesep}{0pt}
\setlength{\abovetopsep}{0pt}
\usepackage{makecell} 
\usepackage{boldline} 


\newcolumntype{?}[1]{!{\vrule width #1}} 
\babelcharproperty{980000}[990000]{direction}{al}  


\title{jhhjjhhj}
\author{}
\date{}

\begin{document}

\chapter{شكر وتقدير} 


\begin{table}[htbp]
\setlength\arrayrulewidth{1pt} 
\begin{center}
\caption{أمثلة لبعض الكلمات المتشابهة باللغات الناقلة}
\rowcolors{2}{white}{gray!25}
\begin{tabular}{?{1mm}c|c|c|>{\centering\arraybackslash}m{5cm}?{1mm}} 
مُلُوكْ & مَلاخيمْ  & الحروف والمعنى & -\\
\hline
نَفْسي & نَفْشِيْ   & الحروف والمعنى & -\\
\bottomrule[1mm] 
\end{tabular}
\label{tab}
\end{center}
\end{table}
\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.