alreq icon indicating copy to clipboard operation
alreq copied to clipboard

Layout (flow direction) of math formula

Open tomerm opened this issue 8 years ago • 9 comments

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

image

image

Not all countries in which Arabic script is used are represented on the images above.

tomerm avatar Mar 06 '17 10:03 tomerm

For additional information on this topic, see https://www.w3.org/TR/2006/NOTE-arabic-math-20060131/

r12a avatar Mar 06 '17 11:03 r12a

The use of European digits in eastern Arabic countries is surprising, what is the source of this data?

khaledhosny avatar Mar 06 '17 14:03 khaledhosny

@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

tomerm avatar Mar 06 '17 15:03 tomerm

To complete Richard, see also here.

ntounsi avatar Mar 06 '17 18:03 ntounsi

Labeling as "future", as we have decided to not get to Math details for the first version.

behnam avatar Mar 07 '17 17:03 behnam

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

longdivision

tomerm avatar Mar 14 '17 05:03 tomerm

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/

tomerm avatar Apr 20 '17 20:04 tomerm

New proposal for expanding Math Formula Preferences in CLDR by @JCEmmons: http://www.unicode.org/L2/L2017/17101-math-formula-prefs.pdf

screen shot 2017-05-02 at 9 52 35 pm

(Personally, I'm not sure how accurate the data in this map is, though.)

Discussion CLDR ticket: http://unicode.org/cldr/trac/ticket/10100

behnam avatar May 03 '17 02:05 behnam

In Morocco, division is written similar to Russian case above. division

ntounsi avatar May 21 '17 22:05 ntounsi