ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Proposal for math mappings
Date: Fri, 10 Dec 2010 10:22:53 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1012101017350.10708@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <op.vnh3c7nqwshuv7@lpr>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 4565 bytes --]

On Fri, 10 Dec 2010, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

> On Fri, 10 Dec 2010 05:49:26 +0100, Aditya Mahajan <adityam@umich.edu> wrote:
>
>> This is a proposal for a new way of selecting math mappings in MkIV. I want
>> to get input from other math users whether this syntax would take care of 
>> all
>> scenarios or not.
>> 
>> There are five different ranges in mathematics:
>> - digits (0..9)
>> - lower case Latin (abc..z)
>> - upper case Latin (ABC..Z)
>> - lower case Greek (αβγ..ζ)
>> - upper case Greek (ΑΒΓ..Z)
>
> Just to confirm -
>
> - 0-9 are 48-57 in ASCII
> - a-z = 97-122
> - A-Z = 65-90
> - LC Greek = ?-? (given by \alpha to \omega range)
> - UC Greek = ?-? (given by \Alpha to \Omega range)
>
> - Is that right?

Yes. In addition, Greek will work even if you key in 0x0391-0x03C9.

>> A user may want to control what each range is mapped to. So, I suggest a 
>> setup
>> command
>>
>>     \setupmathmappings
>>       [
>>          digits={style,alternative},
>>         lclatin={style,alternative},
>>         uclatin={style,alternative},
>>         lcgreek={style,alternative},
>>         ucgreek={style,alternative},
>>       ]
>> 
>
> OK, it might be useful when one wants e.g. ALL Greek letters to be printed 
> somehow, e.g. bold.
>
> I don't think that the basic criterion for style in math is the (alphabet) 
> range, it's rather the meaning of maths 
> (variable/parameter/vector/tensor/operator (e.g. Nabla operator)). But OK -
>
>> where the options for style are
>>
>>   normal, bold
>> 
>> while the options for alternative are
>>
>>   normal, italic, sans, sansitalic, blackboard, script
>> 
>> This command will the mappings for each range. **NOTE**: All combinations 
>> are not valid.
>> 
>> A companion command
>>
>>     \definemathmappings
>>       [whatever]
>>       [....]
>> 
>> can be used to define multiple mappings. These mappings can be used by
>>
>>     \setupmathmappings[whatever]
>> 
>> (An alternative is that these mappings are activated using \whatever ...)
>> 
>> For example, we can define a command to typeset vectors using
>>
>>     \definemathmappings
>>       [vectors]
>>       [ digits={bold,normal},
>>        lclatin={bold,normal},
>>        uclatin={bold,normal},
>>        lcgreek={bold,normal},
>>        ucgreek={bold,normal}]
>>
>>     \def\VEC{\groupedcommand{\setupmathmappings[vector]}{}}
>
> Or rather the following (?): 
> \def\VEC#1{\groupedcommand{\setupmathmappings[vector]}{#1}}

I haven't tested this, but I think that my definition should work (after 
changing vector -> vectors). The point of grouped command is that you can 
use

\VEC{ABC}

as well as

{\VEC ABC}

If you only need the first variant, you can simply define

\def\VEC#1{{\setupmathmappings[vectors]#1}}

>> If later, we want to represent vectors as sans serif, we can use
>>
>>     \definemathmappings
>>       [vectors]
>>       [ digits={normal,sans},
>>        lclatin={normal,sans},
>>        uclatin={normal,sans},
>>        lcgreek={normal,sans},
>>        ucgreek={normal,sans}]
>> 
>
> This kind of switching would be great.
>
>> This interface makes it easy to switch math fonts for disciplines that want
>> different style for different alphabet ranges.
>> 
>> It is relatively easy to implement the above interface. All we need is
>> some bookkeeping to set the right attributes. The default math mapping
>> commands can be reimplmeneted using \definemappings. Before implementing
>> this, I want to ask the opinion of other math users.
>> 
>> Would the above interface take care of different use cases, or is it 
>> missing
>> something?
>
> It looks good. Some examples would be needed, starting at simple ones and 
> ending with "wildly" switching math formulas.
>
>> Finally, I am not too happy with the syntax. There are only a few ConTeXt
>> commands in which the keys take a pair of values. Another option is to 
>> allow all
>> 12 valid options
>>
>>   normal, italic, sans, sansitalic, blackboard, script,
>>   bold, bolditlaic, boldsans, boldsansitalic, boldblackboard, boldscript
>> 
>> with the variants sansitalic-italicsans, boldsans-sansbold, etc. as 
>> synonmyms.
>> 
>> Which way of specifying the keys do you prefer?
>
> Personally, no matter. Programming "clarity" should be kept at most - so it's 
> up to you. When some samples are provided, someone will follow them.

I will provide a more detailed example.

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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	other threads:[~2010-12-10 15:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10  4:49 Aditya Mahajan
2010-12-10 12:41 ` Vladimir Lomov
2010-12-10 15:29   ` Aditya Mahajan
2010-12-11 15:24     ` Otared Kavian
2010-12-10 13:49 ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-12-10 15:22   ` Aditya Mahajan [this message]
2010-12-11 16:28 ` Aditya Mahajan
2010-12-12 16:15   ` Procházka Lukáš
2010-12-13 14:15     ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1012101017350.10708@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).