alreq
alreq copied to clipboard
Layout (flow direction) of math formula
In different countries in which Arabic script is used the direction of math formula is different. It is by all means different in those countries from rest of the world.
In some countries it can be LTR: x + y = z While in others it can be RTL: z = y + x
Some initial information on preferences in different countries is available from: http://www.wiris.com/editor/docs/resources/arabic-numbers-countries


Not all countries in which Arabic script is used are represented on the images above.
For additional information on this topic, see https://www.w3.org/TR/2006/NOTE-arabic-math-20060131/
The use of European digits in eastern Arabic countries is surprising, what is the source of this data?
@khaledhosny Please disregard the digits glyph on images above. Which numbers' shapes (Arabic-European or Arabic-Indic) are used in different countries is "standardized" in CLDR: Arabic numeric shaping (0123456789 vs. ٠ ١٢٣٤٥٦٧٨٩ vs. ...) - appears as part of "Numbering systems" -http://cldr.unicode.org/translation/numbering-systems . For example http://www.unicode.org/repos/cldr/trunk/common/bcp47/number.xml or https://github.com/unicode-cldr/cldr-core/blob/master/supplemental/numberingSystems.json have "٠ ١٢٣٤٥٦٧٨٩" defined as "arab" and "1234567890" defined as "latn". Mapping to locale is done via property <defaultNumberingSystem> which is "arab" for ar (http://unicode.org/cldr/trac/browser/trunk/common/main/ar.xml) but "latn" for ar_MA (http://unicode.org/cldr/trac/browser/trunk/common/main/ar_MA.xml) and ar_DZ (http://unicode.org/cldr/trac/browser/trunk/common/main/ar_DZ.xml) Mentioning this just to make sure that we already have a standard for digits. Thus even if images above deviate from it, we should not be concerned as long as we trust the standard (all this assuming (a) you trust CLDR accuracy and (b) <defaultNumberingSystem> is applicable for math formulas). I called CLDR - standard since it is heavily leveraged by ICU and by now for sure part of IBM, Android, Apple (and possibly Microsoft) platforms / products.
In this specific issue the point is in the formula direction (and possibly also with flipping math symbols such as root symbol, sigma symbol etc.). Numeric shaping is playing secondary role. Both are definitely related. However, numeric shaping is applicable far beyond math formulas.
PS. The source of images is mentioned in the original post: http://www.wiris.com/editor/docs/resources/arabic-numbers-countries
To complete Richard, see also here.
Labeling as "future", as we have decided to not get to Math details for the first version.
Just one additional comment on long division with remainder . There is a big difference between how this basic math operation is written in different countries (see examples below). I realize that such case has very limited usage in both special literature (elementary math books) and by all means in computer world.
Russian: http://www.outsidethebox.ms/delenie-stolbikom/
English:
- https://www.wyzant.com/resources/lessons/math/elementary_math/long_division/long_division_with_remainders
- http://www.calculatorsoup.com/calculators/math/longdivision.php
Hebrew: https://he.wikibooks.org/wiki/%D7%97%D7%A9%D7%91%D7%95%D7%9F/%D7%97%D7%99%D7%9C%D7%95%D7%A7_%D7%90%D7%A8%D7%95%D7%9A
Arabic:
- https://www.youtube.com/watch?v=lr8P2J_LoMg
- http://vb1.alwazer.com/t43710.html
- https://www.youtube.com/watch?v=--4-crgVpAU

Some additional references
- RTL math in the post Directionality in Math Zones: https://blogs.msdn.microsoft.com/murrays/2009/11/12/directionality-in-math-zones/
- Modern Arabic mathematical notation: https://en.wikipedia.org/wiki/Modern_Arabic_mathematical_notation
- Simple web based editor for math formulas: http://www.wiris.com/editor/demo/ar_sa/
New proposal for expanding Math Formula Preferences in CLDR by @JCEmmons: http://www.unicode.org/L2/L2017/17101-math-formula-prefs.pdf
(Personally, I'm not sure how accurate the data in this map is, though.)
Discussion CLDR ticket: http://unicode.org/cldr/trac/ticket/10100
In Morocco, division is written similar to Russian case above.
