TransWikia.com

How to write Arabic maad sign in latex?

TeX - LaTeX Asked on July 15, 2021

I would like to get :

enter image description here

Is there any code to get it?

2 Answers

If I understand your question correctly, you are asking for a Unicode non-breaking space (U+00A0} with a combining maddah above (U+0653).

Here is a solution in LuaLaTeX:

documentclass{article}
tracinglostchars=3
usepackage[bidi=basic, layout=sectioning.tabular, english]{babel}
usepackage{unicode-math}
usepackage{microtype}

defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }
babelprovide[import=ar, onchar=fonts ids]{arabic}

babelfont{rm}
          [Ligatures=Common, Scale=1.0]{Libertinus Serif}
babelfont{sf}
          [Ligatures=Common]{Libertinus Sans}
babelfont{tt}
          {Libertinus Mono}

babelfont[arabic]{rm}
          {Amiri}

setmathfont{Libertinus Math}

newcommandspacingmaddah{foreignlanguage{arabic}{^^^^00a0^^^^0653}}

begin{document}
Hello Maddah, {spacingmaddah}

Hello Faddah.  ٓ
end{document}

Libertinus Serif/Amiri sample

You can change the fonts and the default language to your liking.

It would mostly work, with small modifications, in XeLaTeX. bidi=basic would need to become bidi=default, and you would remove usepackage{microtype} and onchar=fonts ids. The disadvantage is that the document would no longer automatically switch to the Arabic font and hyphenation when it sees Arabic writing. You would need to put foreignlanguage{arabic} and begin{otherlanguage}{arabic} tags everywhere.

Answered by Davislor on July 15, 2021

There are a number of ways to approach Arabic in LaTeX. Since you're using the xetex engine, you may like the arabxetex package:

documentclass[12pt]{article}
usepackage{arabxetex}
newfontfamilyarabicfont[Script=Arabic]{Amiri}
begin{document}
This is textit{maddah:} textarab[utf]{ٓ}
end{document}

output

(Unfortunately, the code doesn’t show up very clearly, at least not with the fonts my browser uses, where the maddah looks like a smudge on the }. To explain, between the {} I’ve simply typed U+0653, using an editor which accepts such input. You should be able to copy and paste my code despite the problem with display.)

Answered by Thérèse on July 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP