1

My question is: how can I highlight specific letters or "accents" of arabic text, without disrupting the connection of the letters? For example, see the gray highlighted text (this was edited in gimp):

specific arabic letters or accents (called diacritics) highlighted

My requirements:

  • the text must be able to include English, Greek and Arabic text
  • must be able to do the actions in a tabular environment
  • should compile with xelatex. I can drop this if the alternative is simple enough use
  • polyglossia and \textarabic. I can drop this and use arabxetex if the alternative is simple enough

What I have tried:

Happy to get instructions for stackengine (with manual labor to place the tikz fills) or a different way of accomplishing this.

Minimal example with arabic text to experiment with:

\documentclass[a4paper]{article}

\usepackage[cm-default]{fontspec}
\setmainfont[Mapping=tex-text]{DejaVu Sans}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.5]{Droid Arabic Naskh} % arabic font

\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguage{arabic}

\begin{document}

\section*{Verbs - Ρήματα}

\begin{tabular}{ c c c c }
\textarabic{ المُفاعَلة } & \textarabic{ يُفَعِّلُ } & \textarabic{ فاعَلَ } & 3 \\
\end{tabular}

\end{document}
vkats
  • 183

1 Answers1

1

You can realize what you want with arabxetex using transliteration form to avoid confusing when typing RTL and LTR words on the same line (problems of readability)

\documentclass[a4paper]{article}

\usepackage[cm-default]{fontspec}
\setmainfont[Mapping=tex-text]{DejaVu Sans}
\newfontfamily\arabicfont[Script=Arabic,Scale=1.5]{Amiri} % arabic font
\usepackage{xcolor}
\usepackage[voc]{arabxetex}

\renewcommand{\fboxsep}{0pt}

\def\h#1{\colorbox{gray}{#1}}

\begin{document}

\section*{Verbs - Ρήματα}

\begin{tabular}{ c c c c }
\textarab{almu-\h{-f-}-a`l-\h{-T}} & 
\textarab{yufa`lu}                 & 
\textarab{f-\h{-a}`l}              &
3 \\
\end{tabular}

\end{document}
Salim Bou
  • 17,021
  • 2
  • 31
  • 76
  • This is good progress but I have some remaining questions: how can I highlight a) the damma and b) the shadda + karsa in the \textarab{yufa``ilu} – vkats Feb 26 '17 at 08:56