1

I am using arabtex package in a booktabs style table. I would like to highlight the initial, medial and final forms of the arabic letters with a color such as red or graying out the rest of the letters. I tried to use something like \RL{\textcolor{gray}.b\textcolor{black}a} but it does not work.

I appreciate any help.

\documentclass[a4paper,11pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{arabtex}
\usepackage{booktabs}


\begin{document} 

\begin{table}[]
\centering
\caption{The Arabic alphabet.}
\label{my-label}
\begin{tabular}{@{}ccccc@{}}
\toprule
Name & \begin{tabular}[c]{@{}c@{}}Standing\\ Alone\end{tabular} & Final & Medial & Initial \\ \midrule
 `alif& \RL{a} & \RL{.baa} & \RL{.baa.b} & \RL{a}  \\
 baa'& \RL{b} & \RL{tb} & \RL{tbt} & \RL{bt} \\
 taa'& \RL{t} & \RL{.bt} &\RL{.bt.b}  & \RL{t.b} \\
 thaa'& \RL{_t} & \RL{.b_t} & \RL{.b_t.b} & \RL{_t.b} \\
 jiim&    \RL{^g}&\RL{.b^g}& \RL{.b^g.b} &\RL{^g.b}  \\
 Haa'&  \RL{h}&  \RL{.bh}&  \RL{.bh.b}& \RL{h.b} \\
 khaa'& \RL{_h} & \RL{.b_h} &\RL{.b_h.b}  & \RL{_h.b} \\
 daal&  \RL{d}& \RL{.bd} & \RL{.bd.b} & \RL{d.b} \\
 dhaal&  \RL{_d}& \RL{.b_d} & \RL{.b_d.b} & \RL{_d.b} \\
 raa'&    \RL{r} &\RL{.br}& \RL{.br.b} &\RL{r.b}  \\
 zaay&    \RL{z}&\RL{.bz}&\RL{.bz.b}  & \RL{z.b} \\
 siin&    \RL{s}&\RL{.bs}& \RL{.bs.b} &\RL{s.b}  \\
 shiin& \RL{^s} & \RL{.b^s} & \RL{.b^s.b} &\RL{.b^s.b}  \\
 Saad& \RL{.s} & \RL{.b.s} & \RL{.b.s.b} & \RL{.s.b} \\
 Daad&  \RL{.d}& \RL{.b.d} &  \RL{.b.d.b}&\RL{.d.b}  \\
 Taa'& \RL{.t} & \RL{.b.t} & \RL{.b.t.b} & \RL{.t.b} \\
 Dhaa'& \RL{.z} & \RL{.b.z} & \RL{.b.z.b} & \RL{.z.b} \\
 `ayn&  \RL{`}&  \RL{.b`}& \RL{.b`.b} & \RL{`.b} \\
 ghayn&\RL{.g}  & \RL{.b.g} & \RL{.b.g.b} & \RL{.g.b} \\
 faa'&\RL{f}  & \RL{.bf} & \RL{.bf.b} &\RL{f.b}  \\
 qaaf& \RL{q} & \RL{.bq} & \RL{.bq.b} & \RL{q.b} \\
 kaaf& \RL{k} & \RL{.bk} & \RL{.bk.b} & \RL{k.b} \\
 gaaf& \RL{g} & \RL{.bg} & \RL{.bg.b} & \RL{g.b} \\
 laam& \RL{l} & \RL{.bl} & \RL{.bl.b} & \RL{l.b} \\
 miim& \RL{m} & \RL{.bm} & \RL{.bm.b} & \RL{m.b} \\
 nuun& \RL{n} & \RL{.bn} & \RL{.bn.b} &\RL{n.b}  \\
 haa'& \RL{h} &  \RL{.bh}& \RL{.bh.b} & \RL{h.b} \\
 waaw& \RL{w}  &  \RL{.bw}& \RL{.bw.b} & \RL{w.b} \\
 yaa'& \RL{_A} & \RL{.b_A} & \RL{.b_A.b} & \RL{_A.b} \\ \bottomrule
\end{tabular}
\end{table}





\end{document}
  • Have you seen https://tex.stackexchange.com/q/84002 ? – Thérèse Apr 02 '18 at 20:18
  • Yes, I did but I am using arabtex package and Latex (instead of XeLatex) in all the other sections, so I would like to specificly use this package. – Yigit Altay Apr 02 '18 at 20:25
  • Right, but one of the answers is for arabtex even though the question is tagged xetex. – Thérèse Apr 02 '18 at 20:27
  • ok I tried it, but when I use acolor it seperates the letters from each other in a word. I need to highlight the letter without breaking the links. – Yigit Altay Apr 02 '18 at 20:48

1 Answers1

2

Be sure you have the most recent version of acolor (the documentation should be dated 31 July 2014), and use it this way:

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{arabtex,booktabs,acolor}
\begin{document}
\begin{table}[]
  \acolor{isolated}{olive}
  \acolor{vowelmarks}{pink!75!purple}
  \acolor{initial}{purple}
  \acolor{medial}{cyan}
  \acolor{final}{teal}
  \acoloron
  \centering
  \caption{The Arabic alphabet.}
  \label{my-label}
  \begin{tabular}{@{}lcccc@{}}
    \toprule
    \scshape name & \scshape isolated & \scshape final & \scshape medial & \scshape initial\\
    \midrule
    `alif & \RL{a}  & \RL{.baa} & \RL{.baa.b} & \RL{a}     \\
    baa'  & \RL{b}  & \RL{tb}   & \RL{tbt}    & \RL{bt}    \\
    taa'  & \RL{t}  & \RL{.bt}  & \RL{.bt.b}  & \RL{t.b}   \\
    thaa' & \RL{_t} & \RL{.b_t} & \RL{.b_t.b} & \RL{_t.b}  \\
    jiim  & \RL{^g} & \RL{.b^g} & \RL{.b^g.b} & \RL{^g.b}  \\
    Haa'  & \RL{h}  & \RL{.bh}  & \RL{.bh.b}  & \RL{h.b}   \\
    khaa' & \RL{_h} & \RL{.b_h} & \RL{.b_h.b} & \RL{_h.b}  \\
    daal  & \RL{d}  & \RL{.bd}  & \RL{.bd.b}  & \RL{d.b}   \\
    dhaal & \RL{_d} & \RL{.b_d} & \RL{.b_d.b} & \RL{_d.b}  \\
    raa'  & \RL{r}  & \RL{.br}  & \RL{.br.b}  & \RL{r.b}   \\
    zaay  & \RL{z}  & \RL{.bz}  & \RL{.bz.b}  & \RL{z.b}   \\
    siin  & \RL{s}  & \RL{.bs}  & \RL{.bs.b}  & \RL{s.b}   \\
    shiin & \RL{^s} & \RL{.b^s} & \RL{.b^s.b} & \RL{.b^s.b}\\
    Saad  & \RL{.s} & \RL{.b.s} & \RL{.b.s.b} & \RL{.s.b}  \\
    Daad  & \RL{.d} & \RL{.b.d} & \RL{.b.d.b} & \RL{.d.b}  \\
    Taa'  & \RL{.t} & \RL{.b.t} & \RL{.b.t.b} & \RL{.t.b}  \\
    Dhaa' & \RL{.z} & \RL{.b.z} & \RL{.b.z.b} & \RL{.z.b}  \\
    `ayn  & \RL{`}  & \RL{.b`}  & \RL{.b`.b}  & \RL{`.b}   \\
    ghayn & \RL{.g} & \RL{.b.g} & \RL{.b.g.b} & \RL{.g.b}  \\
    faa'  & \RL{f}  & \RL{.bf}  & \RL{.bf.b}  & \RL{f.b}   \\
    qaaf  & \RL{q}  & \RL{.bq}  & \RL{.bq.b}  & \RL{q.b}   \\
    kaaf  & \RL{k}  & \RL{.bk}  & \RL{.bk.b}  & \RL{k.b}   \\
    gaaf  & \RL{g}  & \RL{.bg}  & \RL{.bg.b}  & \RL{g.b}   \\
    laam  & \RL{l}  & \RL{.bl}  & \RL{.bl.b}  & \RL{l.b}   \\
    miim  & \RL{m}  & \RL{.bm}  & \RL{.bm.b}  & \RL{m.b}   \\
    nuun  & \RL{n}  & \RL{.bn}  & \RL{.bn.b}  & \RL{n.b}   \\
    haa'  & \RL{h}  & \RL{.bh}  & \RL{.bh.b}  & \RL{h.b}   \\
    waaw  & \RL{w}  & \RL{.bw}  & \RL{.bw.b}  & \RL{w.b}   \\
    yaa'  & \RL{_A} & \RL{.b_A} & \RL{.b_A.b} & \RL{_A.b}  \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

output

Thérèse
  • 12,679
  • 1
    Thanks but this solves the problem half way. I would like to color only the final letters red in the final column, color only the medial letters red in the medial column, and color the initial letters red in the initial column. Is there a way to apply color to a specific position in a specific column by acolor? – Yigit Altay Apr 03 '18 at 04:40
  • It would involve a more manual approach, because you wouldn’t be taking advantage of the linguistic intelligence of the package. But the second Q & A on page 2 of the manual addresses your concern. Sorry, no time to prepare an example of that now: it’s 1:00 in the morning here, and I have a dissertation to read. – Thérèse Apr 03 '18 at 04:58
  • OK I did it manually indeed. So a line look like this: – Yigit Altay Apr 03 '18 at 05:04
  • 1
    Dhaa'& \RL{.z} & \acolor{initial}{gray!20}\RL{.b.z} & \acolor{initial}{gray!20}\acolor{final}{gray!20}\RL{.b.z.b} & \acolor{final}{gray!20}\RL{.z.b} \ – Yigit Altay Apr 03 '18 at 05:04