[NTG-context] Latin setupmathematics

Hans Åberg haberg-1 at telia.com
Sun May 15 19:42:49 CEST 2016


> On 15 May 2016, at 19:08, Hans Hagen <pragma at wxs.nl> wrote:
> 
> On 5/15/2016 4:28 PM, Hans Åberg wrote:
>> 
>>> On 15 May 2016, at 15:37, Hans Hagen <pragma at wxs.nl> wrote:
>>> 
>>> On 5/14/2016 7:11 PM, Hans Åberg wrote:
>>>> In order to align with Unicode, \setupmathematics might have Latin shape options, as the Greek ‘lcgreek’ and ‘ucgreek', say ‘lclatin' and ‘uclatin', both defaulting to ’italic’. Unicode added the Latin italic symbols to the Math Alphanumeric Symbols range, so the upright letters are inaccessible when italic is assigned to the Basic Latin (ASCII) range.
>>> 
>>> I'm not sure what you mean. One can use \mathupright if needed. We support all the alphabets and these are independent of the basic latin range.
>> 
>> Traditionally constants are set in upright and variables in italic. So constants like “log” etc., are set in upright. It is not used rigorously because of past typographical limitations, but one might in principle do that, cf. the example below, where the integral differential “d” is set in upright to disambiguate relative the function named “d”.
>> 
>> When Unicode added math styles, it added italics, expecting the ASCII range to be upright, which would be normal if using a text editor that does not translate math into italics. But the TeX legacy is the opposite.
>> 
>> ----
>> \setupbodyfont[xits,10pt]
>> 
>> \startformula
>> \startalign
>>   I &= ∫_S d(x)\, dx \NR
>>   I &= ∫_S 𝑑(x)\, dx \NR
>>   I &= ∫_S d(x)\, \mathupright{d} x \NR
>>   I &= ∫_S 𝑑(x)\, \mathupright{d} x \NR
>> \stopalign
>> \stopformula
> 
> well, i guess unicode assumed messing with math input characters anyway (given that some alphabets have holes) and a normal upright alphabet would have made sense (after all emojs get added by the dozen every time and there is no end at that so why on math)

I do not know why it wasn’t added, but it is te same with the Greek letters, for which there are special options.

Another example is the bold italic, that in the past wasn’t available much in typography, so one substituted the bold upright. But both are now available in Unicode, so it would not pose the same problem.

> anyway, so you want no mapping then, so this means something like
> 
> \unprotect
>    \let\mathitalic\mathdefault
>    \appendtoks
>        \edef\p_default{\mathematicsparameter\c!default}%
>        \ifx\p_default\v!normal
>          \let\mathdefault\mathupright
>        \else
>          \let\mathdefault\mathitalic
>        \fi
>    \to \everysetupmathematics
> \protect
> 
> \setupmathematics[default=normal]
> 
> (where of course we default to default=italic)

Yes, but perhaps another name than “default”.

> i have no problem adding that (basically one can even go as far as disabling every mapping assuming pure unicode input but i guess that users then would still ask for \mathfoo commands)

I think it is simplest to just align with Unicode.

> and of course we need more math fonts that have monospace (one is in the making in the gyre project)

It is available in the STIX fonts. These, and the sans-serif math styles are added in error of the idea of expressing math semantics, as pure math uses serifs, and applied sciences may use sans-serif. In computer code, in the past, like the 1980s, one did not care about monospace in books, and there is no semantic difference between styles. Keywords might for example be displayed i bold, but there is not semantic difference to when they are not.

Perhaps TeX commands might use the monospace math styles. Then the backslash “\” would not be needed. But right now, input would be cumbersome.





More information about the ntg-context mailing list