From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64423 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Proposal for math mappings Date: Sat, 11 Dec 2010 11:28:55 -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-1643360499-1292084942=:22443" X-Trace: dough.gmane.org 1292084972 31150 80.91.229.12 (11 Dec 2010 16:29:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Dec 2010 16:29:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 11 17:29:26 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 1PRSK5-0000nZ-O8 for gctc-ntg-context-518@m.gmane.org; Sat, 11 Dec 2010 17:29:25 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B6C09CA8B9; Sat, 11 Dec 2010 17:29:24 +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 jye1MtRQE+1i; Sat, 11 Dec 2010 17:29:24 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F3624CA8B0; Sat, 11 Dec 2010 17:29:20 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1DAD2CA8B0 for ; Sat, 11 Dec 2010 17:29: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 Qjo60MH3xEk6 for ; Sat, 11 Dec 2010 17:29: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 3D251CA88B for ; Sat, 11 Dec 2010 17:29:16 +0100 (CET) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBBGTDRa031837 for ; Sat, 11 Dec 2010 17:29:15 +0100 Original-Received: FROM [10.0.2.15] (Unknown [117.197.149.134]) By tombraider.mr.itd.umich.edu ID 4D03A6D6.C9D2A.21248 ; Authuser adityam; 11 Dec 2010 11:29:11 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.12.86; 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: 05DFQtedF - 31b3fbb6fbd3 - 20101211 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:64423 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-1643360499-1292084942=:22443 Content-Type: TEXT/PLAIN; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE I'll try once more to explain the setup. If I understand the unicode philosopy correctly, then we do not any font=20 switching macros in math. If we want math italic A, we can simply type=20 0x1D434; if we want math bold A, we can type 0x1D400; and so on. One difficulty with this approach is that it is not easy to type (and see)= =20 these characters in an editor. One way to circumvent this, as is done by=20 the latex unicode-math package, is to define a macro for each symbol:=20 \mathitA, \mathbfA, etc. Even if we define such macros, writing such macros is inconvinient. A more= =20 nature way is to write $A {\bf A}$ rather than $\mathitA \mathbfA$ etc.=20 Traditionally, commands like \bf, \it, etc are font switches. However, in= =20 unicode math, rather than font switches, these macros are simply input=20 mapping commands. Thus, by default, 0x0041 (latin A) maps to 0x1D434 (math= =20 italic A), and so on. If \bf is active, 0x0041 (latin A) maps to 0x1D400=20 (math bold A), and so on. Roughly speaking, this is how \bf. \it, \bi, \cal, \Bbd, etc work in the=20 background. However, at present these mappings are unsatisfactory. For=20 example, by default, 0x03B1 (Greek alpha) maps 0x1D6FC (Math italic small= =20 alpha), while 0xO391 (Greek capital Alpha) maps to itself. What should=20 these mappings be when \bf is active? Or when \bi is active? The trouble with the current implementation of \bf, \bi, \cal, etc is that= =20 these mappings are not explicitly specified. My proposal is to allow users= =20 to customize these mappings. I agree that digits, upper and lower case latin and greek does not capture= =20 all mathematic characters for which such mappings are needed. Similar=20 mappings might also be needed for some symbols like nabla (are there other= =20 such symbols?). These can also be added as a key like nabla=3D{normal,italic} or nabla=3D{bold,normal} Hopefully, the above explanation makes more sense. Aditya On Thu, 9 Dec 2010, Aditya Mahajan wrote: > This is a proposal for a new way of selecting math mappings in MkIV. I wa= nt > 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 (=E1=E2=E3..=E6) > - upper case Greek (=C1=C2=C3..Z) > > 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}, > ] > > 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=20 > 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=3D{bold,normal}, > lclatin=3D{bold,normal}, > uclatin=3D{bold,normal}, > lcgreek=3D{bold,normal}, > ucgreek=3D{bold,normal}] > > \def\VEC{\groupedcommand{\setupmathmappings[vector]}{}} > > 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}] > > This interface makes it easy to switch math fonts for disiplines that wan= t > different style for different alphabet ranges. > > It is relatively easy to implement the above interface. All we need is so= me=20 > bookkeeping to set the right attributes. The default math mapping command= s=20 > can be reimplmeneted using \definemappings. Before implementing this, I w= ant=20 > to ask the opinion of other math users. > > Would the above interface take care of different use cases, or is it miss= ing > something? > > 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 al= low=20 > 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=20 > synonmyms. > > Which way of specifying the keys do you prefer? > > Aditya --8323328-1643360499-1292084942=:22443 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-1643360499-1292084942=:22443--