From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79453 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: \unit problem with powers of ten. Date: Thu, 22 Nov 2012 15:51:24 +0100 Message-ID: References: <201211192344.31404.romain.diss@yahoo.fr> <201211201443.22353.romain.diss@yahoo.fr> <201211221545.52542.romain.diss@yahoo.fr> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2081428489==" X-Trace: ger.gmane.org 1353595894 11429 80.91.229.3 (22 Nov 2012 14:51:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Nov 2012 14:51:34 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 22 15:51:46 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TbY7z-0006c1-8e for gctc-ntg-context-518@m.gmane.org; Thu, 22 Nov 2012 15:51:43 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7AEB3103C1; Thu, 22 Nov 2012 15:51:32 +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 VaNjmdKQK8xe; Thu, 22 Nov 2012 15:51:29 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0496D102F5; Thu, 22 Nov 2012 15:51:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E464E102F5 for ; Thu, 22 Nov 2012 15:51:26 +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 u6LNsrfkJibw for ; Thu, 22 Nov 2012 15:51:25 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 977A2102E9 for ; Thu, 22 Nov 2012 15:51:25 +0100 (CET) Original-Received: from mail-ea0-f169.google.com (mail-ea0-f169.google.com [209.85.215.169]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qAMEpOhT007451 for ; Thu, 22 Nov 2012 15:51:24 +0100 Original-Received: by mail-ea0-f169.google.com with SMTP id a12so3057085eaa.14 for ; Thu, 22 Nov 2012 06:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=g8+oAYDUeBq1USDL2o+DtWm11Yit3T7R4G6Vnx0VAnk=; b=x9kJ8SzXVCf5eBHXsUYzH27DgJgdujCfnzzxe8+V+5xqSc/rzKqgdsINLzHROUM+A3 CRhUx/fUNc8v7Wab8L4tvxb6vfyb+7to8+USeAFui4XRK8CoLIEF7z/GO2dUBgaS5gmm hQMyxhy5JTfn3ayCfePwaeh0loi7+yDeQxTclNTwonipYK34uA98KdVxiLDbp+BTXirJ xeV+/TVF+z//tHh28ooekziI/+hVzQN7PrToPqpI25GnG8/Sp4DuE8QKMN93O63NPDJB zHJ+7dg0izPztH8xXvS5Q3bSY7QM5/XJtfR2RhMiqKyn1JYpL/kf3/N6RPodpb0Yc0IK bqYA== Original-Received: by 10.14.178.195 with SMTP id f43mr2010496eem.44.1353595884261; Thu, 22 Nov 2012 06:51:24 -0800 (PST) Original-Received: by 10.223.12.140 with HTTP; Thu, 22 Nov 2012 06:51:24 -0800 (PST) In-Reply-To: <201211221545.52542.romain.diss@yahoo.fr> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TIqCPoQ8 - 55cd5439998b - 20121122 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79453 Archived-At: --===============2081428489== Content-Type: multipart/alternative; boundary=047d7b621c74d9cfd304cf169994 --047d7b621c74d9cfd304cf169994 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable At least me have seen your post and tried some solutions, but nothing useful.... On Thu, Nov 22, 2012 at 3:45 PM, Romain Diss wrote: > Hi all, > > Le mardi 20 novembre 2012, Romain Diss a =C3=A9crit : > > Le lundi 19 novembre 2012, Romain Diss a =C3=A9crit : > > > I got some problems to express powers of ten in the \unit command. Se= e > > > the strange behaviour with these two minimal examples. > > > > > > \starttext > > > \unit{10^2 meter}\\ > > > \unit{10^{-12} second} > > > \stoptext > > > Is this a bug or are these expressions not supported? > > > > I'm not an expert neither in TeX nor Lua, but I quickly glance at the > > source code (phys-dim.*) and here is what I understand: > > =E2=80=94 the brackets { } are not recognized (a comment in the lua cod= e > mentioned > > it), so \unit{10^{-12} second} should be \unit{10^-12 second}; > > =E2=80=94 the hat sign '^' is recognized as 'e' so it means "=E2=80=A6 = times ten to the > > power=E2=80=A6" instead of "to the power=E2=80=A6" as one should expect= . > > > > So I come back to my problem. I want to write 10=E2=81=BB=C2=B9=C2=B2 s= (ten to the > negative > > twelfth power second). Actually, I'm typing \math{10^{-12} \unit{second= }} > > but I'd prefer to type \unit{10^-12 second} (for coherence). Is it > > possible to modify phys-dim.lua in that way or is this to much work (I > > have no idea if this is a matter of changing one line or a hundred line= s > > in phys-dim.lua. Maybe also this is a too specific request, I don't kno= w=E2=80=A6 > > Nobody seems very enthusiastic concerning this thread so I tried to go > further > in the comprehension of the phys-dim.lua code. I now have found an > approximate > solution to my problem : > \unit{$10^{-12}$ second} > give the right result. It is not very satisfactory because I'm now used t= o > use > \m{} instead of $ $. In the phys-dim.lua code, the line 64 shows that \m{= } > can > be used inside \unit{} but this doesn't work for: > \unit{\m{10^{-12}} second} > because the pattern doesn't handle nested curly braces. > > Is there any Lua expert to find a pattern to handle exponents? > > Thank you. > > -- > Romain Diss > > > _________________________________________________________________________= __________ > 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 > > _________________________________________________________________________= __________ > --=20 luigi --047d7b621c74d9cfd304cf169994 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable At least me have seen your post and tried some solutions, but nothing usefu= l....


On T= hu, Nov 22, 2012 at 3:45 PM, Romain Diss <romain.diss@yahoo.fr><= /span> wrote:
Hi all,

Le mardi 20 novembre 2012, Romain Diss a =C3=A9crit :
> Le lundi 19 novembre 2012, Romain Diss a =C3=A9crit = :
> > I got some problems to express powers of ten in the \unit command= . See
> > the strange behaviour with these two minimal examples.
> >
> > \starttext
> > \unit{10^2 meter}\\
> > \unit{10^{-12} second}
> > \stoptext
> > Is this a bug or are these expressions not supported?
>
> I'm not an expert neither in TeX nor Lua, but I quickly glance at = the
> source code (phys-dim.*) and here is what I understand:
> =E2=80=94 the brackets { } are not recognized (a comment in the lua co= de mentioned
> it), so \unit{10^{-12} second} should be \unit{10^-12 second};
> =E2=80=94 the hat sign '^' is recognized as 'e' so it = means "=E2=80=A6 times ten to the
> power=E2=80=A6" instead of "to the power=E2=80=A6" as o= ne should expect.
>
> So I come back to my problem. I want to write 10=E2=81=BB=C2=B9=C2=B2 = s (ten to the negative
> twelfth power second). Actually, I'm typing \math{10^{-12} \unit{s= econd}}
> but I'd prefer to type \unit{10^-12 second} (for coherence). Is it=
> possible to modify phys-dim.lua in that way or is this to much work (I=
> have no idea if this is a matter of changing one line or a hundred lin= es
> in phys-dim.lua. Maybe also this is a too specific request, I don'= t know=E2=80=A6

Nobody seems very enthusiastic concerning this thread so I tried to g= o further
in the comprehension of the phys-dim.lua code. I now have found an approxim= ate
solution to my problem :
\unit{$10^{-12}$ second}
give the right result. It is not very satisfactory because I'm now used= to use
\m{} instead of $ $. In the phys-dim.lua code, the line 64 shows that \m{} = can
be used inside \unit{} but this doesn't work for:
\unit{\m{10^{-12}} second}
because the pattern doesn't handle nested curly braces.

Is there any Lua expert to find a pattern to handle exponents?

Thank you.

--
Romain Diss
<romain.diss@yahoo.fr> ___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-context@ntg.nl / <= a href=3D"http://www.ntg.nl/mailman/listinfo/ntg-context" target=3D"_blank"= >http://www.ntg.nl/mailman/listinfo/ntg-context
webpage =C2=A0: http= ://www.pragma-ade.nl / http://tex.aanhet.net
archive =C2=A0: http://foundry.supelec.fr/projects/contextrev/
wiki =C2=A0 =C2=A0 : http://contextgarden.net
___________________________________________________________________________= ________



--
lui= gi

--047d7b621c74d9cfd304cf169994-- --===============2081428489== 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 ___________________________________________________________________________________ --===============2081428489==--