From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71472 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: [OT] intelligent commas in math (in LaTeX) Date: Fri, 30 Sep 2011 22:12:13 -0400 (EDT) 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-1150444625-1317435134=:26779" X-Trace: dough.gmane.org 1317435064 9021 80.91.229.12 (1 Oct 2011 02:11:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Oct 2011 02:11:04 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Oct 01 04:11:00 2011 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 1R9p2Z-0006VK-VH for gctc-ntg-context-518@m.gmane.org; Sat, 01 Oct 2011 04:11:00 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B6453CAFC3; Sat, 1 Oct 2011 04:10:58 +0200 (CEST) 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 wYhHmjOzaxby; Sat, 1 Oct 2011 04:10:55 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 892D3CAFC0; Sat, 1 Oct 2011 04:10:55 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1B7A8CAFC0 for ; Sat, 1 Oct 2011 04:10:54 +0200 (CEST) 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 PvV3izpKH2Zp for ; Sat, 1 Oct 2011 04:10:42 +0200 (CEST) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 75DBFCAFB5 for ; Sat, 1 Oct 2011 04:10:42 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p912AdBm023188 for ; Sat, 1 Oct 2011 04:10:41 +0200 Original-Received: FROM adi-netbook (bas3-montreal02-1096682717.dsl.bell.ca [65.94.12.221]) By hellskitchen.mr.itd.umich.edu ID 4E86769D.DFBB6.13343 ; Authuser adityam; 30 Sep 2011 22:10:38 EDT In-Reply-To: User-Agent: Alpine 2.02 (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: 0cFDeaDV8 - b75e542dd16f - 20111001 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:71472 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-1150444625-1317435134=:26779 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE >> In principle a cleaner implementation is possible in luatex (without usi= ng >> 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=20 not as part of the export macros. For example: \m{x + 1.25y =3D 3.5} exports as =F0=9D=91=A5+1.2= 5=F0=9D=91=A6=3D3.5<= /m:math> Notice that 1.25 is part of a single tag. In contrast, if you use comma as a math delimiter, then the export=20 function does not recognize the number correctly. \m{x + 1,25y =3D 3.5} exports as =F0=9D=91=A5+1,25=F0=9D=91=A6=3D= 3,5 However, we do have a \mn macro (math number) to tag numbers. So you can=20 type \m{x + \mn{1,25}y =3D \mn{3,5}} which exports as =F0=9D=91=A5+1,2= 5=F0=9D=91=A6=3D3,5<= /m:math> So, if we want to recognize ',' as a decimal separator, two solutions are= =20 possible in MkIV. The first is to build upon the existing export code that= =20 recognizes '.' as a decimal separator (to figure out the contents of the=20 tag) to also recognize ',' as a decimal separator; The drawback of such an approach is that if you are in the habit of not=20 adding a space after a comma, for example writing "Let $\naturalnumbers$=20 denote the set $\{1,2,3,\dots\}$ of natural numbers..." then you will get= =20 wrong output. So, an alternative option is to ask the user to tag all numbers with \mn.= =20 Then, the \mn{...} macro can redefine the comma so that the spaces around= =20 it match its use as a decimal separator. Aditya --8323328-1150444625-1317435134=:26779 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-1150444625-1317435134=:26779--