From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64402 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Proposal for math mappings Date: Fri, 10 Dec 2010 10:22:53 -0500 (EST) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-291955345-1291994584=:10708" X-Trace: dough.gmane.org 1291994611 12241 80.91.229.12 (10 Dec 2010 15:23:31 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Dec 2010 15:23:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 10 16:23:27 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PR4og-0003bg-JC for gctc-ntg-context-518@m.gmane.org; Fri, 10 Dec 2010 16:23:26 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BFD18CA8AE; Fri, 10 Dec 2010 16:23:25 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qcJdG7LlXZTA; Fri, 10 Dec 2010 16:23:21 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C84FACA8A5; Fri, 10 Dec 2010 16:23:21 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8F0AECA8A5 for ; Fri, 10 Dec 2010 16:23:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zUhhjpDWml2R for ; Fri, 10 Dec 2010 16:23:16 +0100 (CET) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id D0929C9E8B for ; Fri, 10 Dec 2010 16:23:16 +0100 (CET) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBAFNEHi032525 for ; Fri, 10 Dec 2010 16:23:16 +0100 Original-Received: FROM [10.0.2.15] (Unknown [117.197.151.67]) By hellskitchen.mr.itd.umich.edu ID 4D0245DF.1B6E0.4937 ; Authuser adityam; 10 Dec 2010 10:23:12 EST In-Reply-To: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.82; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 05DFrnemr - c94d5153c49b - 20101210 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.216 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:64402 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-291955345-1291994584=:10708 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 10 Dec 2010, Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - Pontex s. r. o. = wrote: > On Fri, 10 Dec 2010 05:49:26 +0100, Aditya Mahajan wr= ote: > >> This is a proposal for a new way of selecting math mappings in MkIV. I w= ant >> to get input from other math users whether this syntax would take care o= f=20 >> all >> scenarios or not. >>=20 >> There are five different ranges in mathematics: >> - digits (0..9) >> - lower case Latin (abc..z) >> - upper case Latin (ABC..Z) >> - lower case Greek (=CE=B1=CE=B2=CE=B3..=CE=B6) >> - upper case Greek (=CE=91=CE=92=CE=93..Z) > > Just to confirm - > > - 0-9 are 48-57 in ASCII > - a-z =3D 97-122 > - A-Z =3D 65-90 > - LC Greek =3D ?-? (given by \alpha to \omega range) > - UC Greek =3D ?-? (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= =20 >> setup >> command >> >> \setupmathmappings >> [ >> digits=3D{style,alternative}, >> lclatin=3D{style,alternative}, >> uclatin=3D{style,alternative}, >> lcgreek=3D{style,alternative}, >> ucgreek=3D{style,alternative}, >> ] >>=20 > > OK, it might be useful when one wants e.g. ALL Greek letters to be printe= d=20 > somehow, e.g. bold. > > I don't think that the basic criterion for style in math is the (alphabet= )=20 > range, it's rather the meaning of maths=20 > (variable/parameter/vector/tensor/operator (e.g. Nabla operator)). But OK= - > >> where the options for style are >> >> normal, bold >>=20 >> while the options for alternative are >> >> normal, italic, sans, sansitalic, blackboard, script >>=20 >> This command will the mappings for each range. **NOTE**: All combination= s=20 >> are not valid. >>=20 >> A companion command >> >> \definemathmappings >> [whatever] >> [....] >>=20 >> can be used to define multiple mappings. These mappings can be used by >> >> \setupmathmappings[whatever] >>=20 >> (An alternative is that these mappings are activated using \whatever ...= ) >>=20 >> For example, we can define a command to typeset vectors using >> >> \definemathmappings >> [vectors] >> [ digits=3D{bold,normal}, >> lclatin=3D{bold,normal}, >> uclatin=3D{bold,normal}, >> lcgreek=3D{bold,normal}, >> ucgreek=3D{bold,normal}] >> >> \def\VEC{\groupedcommand{\setupmathmappings[vector]}{}} > > Or rather the following (?):=20 > \def\VEC#1{\groupedcommand{\setupmathmappings[vector]}{#1}} I haven't tested this, but I think that my definition should work (after=20 changing vector -> vectors). The point of grouped command is that you can= =20 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=3D{normal,sans}, >> lclatin=3D{normal,sans}, >> uclatin=3D{normal,sans}, >> lcgreek=3D{normal,sans}, >> ucgreek=3D{normal,sans}] >>=20 > > This kind of switching would be great. > >> This interface makes it easy to switch math fonts for disciplines that w= ant >> different style for different alphabet ranges. >>=20 >> 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. >>=20 >> Would the above interface take care of different use cases, or is it=20 >> missing >> something? > > It looks good. Some examples would be needed, starting at simple ones and= =20 > ending with "wildly" switching math formulas. > >> Finally, I am not too happy with the syntax. There are only a few ConTeX= t >> commands in which the keys take a pair of values. Another option is to= =20 >> allow all >> 12 valid options >> >> normal, italic, sans, sansitalic, blackboard, script, >> bold, bolditlaic, boldsans, boldsansitalic, boldblackboard, boldscript >>=20 >> with the variants sansitalic-italicsans, boldsans-sansbold, etc. as=20 >> synonmyms. >>=20 >> Which way of specifying the keys do you prefer? > > Personally, no matter. Programming "clarity" should be kept at most - so = it's=20 > up to you. When some samples are provided, someone will follow them. I will provide a more detailed example. Aditya --8323328-291955345-1291994584=:10708 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --8323328-291955345-1291994584=:10708--