1

Regarding the multiple letters macro "\FormatChars" posted in Emphasizing Arabic text characters. Is there a way to modify this macro such that:

  • You can select any set of characters you want to modify despite of their arrangement within the word, I have noticed that you can only select a consecutive set of letters (so you select letters from 1 till 3, 2 till 4...) yet there is a need to select non-consecutive characters within the same word (the first and third letters for example, or second and fifth letter...etc)

  • Set the formatting to be applied for each of the selected characters seperately so that a different type of formatting can be applied to each of the selected characters instead of applying the same formatting to all of the specified characters.

Silva
  • 743

1 Answers1

2

You can use lua-ul package which highlight or underline letters of word without breaking ligatures, kerning, font shaping.

You can also create your own format of underlining with \newunderlinetype.

\documentclass{article}
\usepackage[bidi=basic]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}{Amiri}
\usepackage{luacolor,lua-ul}
\begin{document}

\Huge

\highLight[red]{ج}\underLine{نو}\highLight[yellow]{ب} \quad \textcolor{red}{ج}\underLine{نو}\textcolor{blue}{ب} \quad \underLine{\textcolor{red}{ج}نو}\highLight[green]{\textcolor{red}{ب}} \quad % Coloring diacritical marks ج% \textcolor{blue}{َ}% fatha نوب% \textcolor{red}{ٌ}% tanween

\end{document}

enter image description here

Salim Bou
  • 17,021
  • 2
  • 31
  • 76
  • Where can I find the definitions of the diacritical marks in lualatex for each language , and how does the command % fatha... work? IS there a reference to emphaszie such type of syntax? – Silva Aug 19 '20 at 19:07
  • @Silva I have just inserted fatha َ and tanween ٌ inside \textcolor{blue}{} and \textcolor{red}{} commands. – Salim Bou Aug 19 '20 at 19:50
  • @Silva you need to add luacolor package without it you lose font shaping in case of using \textcolor (lualatex engine). – Salim Bou Aug 19 '20 at 19:56