From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79494 Path: news.gmane.org!not-for-mail From: Sietse Brouwer Newsgroups: gmane.comp.tex.context Subject: Re: A problem with units Date: Sat, 24 Nov 2012 01:39:43 +0100 Message-ID: References: <20121123235619.40993358@aga-netbook> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353717620 9083 80.91.229.3 (24 Nov 2012 00:40:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Nov 2012 00:40:20 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Nov 24 01:40:32 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 1Tc3nM-0006fS-Mf for gctc-ntg-context-518@m.gmane.org; Sat, 24 Nov 2012 01:40:32 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 574361037D; Sat, 24 Nov 2012 01:40:21 +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 TKxpgcqBXHt4; Sat, 24 Nov 2012 01:40:19 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 92D0B1032C; Sat, 24 Nov 2012 01:40:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EBBC61032C for ; Sat, 24 Nov 2012 01:40:17 +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 jf6SEn2PdQ19 for ; Sat, 24 Nov 2012 01:40:17 +0100 (CET) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id DCA28101E0 for ; Sat, 24 Nov 2012 01:40:16 +0100 (CET) Original-Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qAO0eEOl005090 for ; Sat, 24 Nov 2012 01:40:15 +0100 Original-Received: by mail-ie0-f169.google.com with SMTP id c14so513857ieb.14 for ; Fri, 23 Nov 2012 16:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=/Gpq1VRgTkTy4KuXi9ZRXgDURnZpDnv8hkhcbGppMPc=; b=CWGGfb7AQc2q5ECfPZfWUyVRB2veFANgCymElzNpKJ54av+azoztZDVPekviFbkai2 Yh+Mza0nbhMGf6lj/wTsR6jLot6UiXQXziD3XZFLBRJPm4vMtZqSWOviV5CJ+xABqpv+ 9pRWeqCmgMTyGTI7iTuqDPZmiLX4wxAyWHMTLxX4DKjkIQ/yjWwqR29zoYYsdE4X0OFA EnmY7mqrXC/nzdwHZDIIP8Po5hmltUUdpyK5LKz9v1IeZcgFVWjqJeDFVDSySij7Wm/g B7w9ueXnVSmzxC0XxlEyRwVCCiKoeDIcPYfYnpGeA2pXw/tAJgfOPixtpkYHuIVoMJOF A0Hw== Original-Received: by 10.42.72.130 with SMTP id o2mr4474863icj.7.1353717614059; Fri, 23 Nov 2012 16:40:14 -0800 (PST) Original-Received: by 10.64.5.138 with HTTP; Fri, 23 Nov 2012 16:39:43 -0800 (PST) In-Reply-To: <20121123235619.40993358@aga-netbook> X-Bayes-Prob: 0.0404 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.223.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: 07IrcEfbh - f09a5ff29623 - 20121124 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:79494 Archived-At: Marcin wrote: > being quite happy with things like \unit{10 km/h}, once I did \unit{45 > min}, only to get "45 m" in the resulting file. I suspect that \unit > does not know about minutes; is there any way to teach it;)? I think 'min' is parsed as 'meter nil nil', because (1) min is not found in the list of short or long unit names, so it's assumed to be composite; and (2) once processed composite, m-->meter-->m, while i-->nil and n-->nil. Solution: add 'min' to the list of short unit names (below). Cheers, Sietse % phys-dim.lua local short_units = { -- I'm not sure about casing m = "meter", Hz = "hertz", hz = "hertz", B = "bel", b = "bel", lx = "lux", -- da = "dalton", h = "hour", s = "second", g = "gram", n = "newton", v = "volt", t = "tonne", l = "liter", -- w = "watt", W = "watt", -- a = "ampere", A = "ampere", + min = "minute", [utfchar(0x2103)] = "celsius", [utfchar(0x2109)] = "fahrenheit", } ___________________________________________________________________________________ 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 ___________________________________________________________________________________