In principle a cleaner implementation is possible in luatex (without using
active characters), but I am not completely sure about this. It will be
better to handle this as part of \mnum macro.

Hm, can you explain this a bit ?

Currently ConTeXt already checks if '.' is part of a complete number or not as part of the export macros. For example:

\m{x + 1.25y = 3.5}

exports as

<m:math display="inline"><m:mrow><m:mi>𝑥</m:mi><m:mo>+</m:mo><m:mn>1.25</m:mn><m:mi>𝑦</m:mi><m:mo>=</m:mo><m:mn>3.5</m:mn></m:mrow></m:math>

Notice that 1.25 is part of a single <m:mn> tag.

In contrast, if you use comma as a math delimiter, then the export function does not recognize the number correctly.

\m{x + 1,25y = 3.5}

exports as

<m:math display="inline"><m:mrow><m:mi>𝑥</m:mi><m:mo>+</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>25</m:mn><m:mi>𝑦</m:mi><m:mo>=</m:mo><m:mn>3</m:mn><m:mo>,</m:mo><m:mn>5</m:mn></m:mrow></m:math>

However, we do have a \mn macro (math number) to tag numbers. So you can type

\m{x + \mn{1,25}y = \mn{3,5}}

which exports as

<m:math display="inline"><m:mrow><m:mi>𝑥</m:mi><m:mo>+</m:mo><m:mn>1,25</m:mn><m:mi>𝑦</m:mi><m:mo>=</m:mo><m:mn>3,5</m:mn></m:mrow></m:math>


So, if we want to recognize ',' as a decimal separator, two solutions are possible in MkIV. The first is to build upon the existing export code that recognizes '.' as a decimal separator (to figure out the contents of the <mn> tag) to also recognize ',' as a decimal separator;

The drawback of such an approach is that if you are in the habit of not adding a space after a comma, for example writing "Let $\naturalnumbers$ denote the set $\{1,2,3,\dots\}$ of natural numbers..." then you will get wrong output.

So, an alternative option is to ask the user to tag all numbers with \mn. Then, the \mn{...} macro can redefine the comma so that the spaces around it match its use as a decimal separator.

Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to