3

How to get right to left arabic characters inside a tabular environment with the arabi package without to have to insert the \AR command in each cell ?

\documentclass[A4,12pt]{article}
  \usepackage[ utf8 ]{inputenc}
  \usepackage[LAE]{fontenc}
  \usepackage[arabic]{babel} 

  \begin{document}

       الإسم 

      اللقب

     تاريخ الإزدياد   


  \vspace{2cm}

  \begin{tabular}{*{3}{c|}}

   الإسم&
  \AR{اللقب}&
   تاريخ الإزدياد  

 \end{tabular}

\end{document}
5

You can take advantage of array to create a new column type, first you need to define a Box which save the contents of the cell

\newsavebox{\RTLbox}
\newcolumntype{R}{>{\begin{lrbox}{\RTLbox}}c<{\end{lrbox}\AR{\unhbox\RTLbox}}}

Code

\documentclass[a4paper,12pt]{article}
\usepackage[ utf8 ]{inputenc}
\usepackage[LAE]{fontenc}
\usepackage[arabic]{babel} 
\usepackage{array}

\newsavebox{\RTLbox}
\newcolumntype{R}{>{\begin{lrbox}{\RTLbox}}c<{\end{lrbox}\AR{\unhbox\RTLbox}}}

\begin{document}

       الإسم

      اللقب

     تاريخ الإزدياد


\vspace{2cm}

\begin{tabular}{*{3}{R|}}

   الإسم&
  اللقب &
تاريخ الإزدياد  

\end{tabular}

\end{document}

Output

enter image description here

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.