From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/65629 Path: news.gmane.org!not-for-mail From: Florian Wobbe Newsgroups: gmane.comp.tex.context Subject: trying to fix page ranges in bibliography Date: Sun, 30 Jan 2011 00:58:38 +0100 Message-ID: <35101397-91D5-43D3-BDD2-35AE0D5602D5@awi.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1296345553 9523 80.91.229.12 (29 Jan 2011 23:59:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 29 Jan 2011 23:59:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jan 30 00:59:07 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 1PjKh8-0004mn-V2 for gctc-ntg-context-518@m.gmane.org; Sun, 30 Jan 2011 00:59:07 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D69FDCA9C1; Sun, 30 Jan 2011 00:59:05 +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 tKCuG5OygsZr; Sun, 30 Jan 2011 00:59:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1D54FCA993; Sun, 30 Jan 2011 00:59:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 14247CA993 for ; Sun, 30 Jan 2011 00:59:01 +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 whNVZ6-olKaL for ; Sun, 30 Jan 2011 00:58:49 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 9E5EDCA988 for ; Sun, 30 Jan 2011 00:58:49 +0100 (CET) Original-Received: from mails3.awi.de (mails3.AWI.DE [134.1.2.14]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0TNwm6H016455 for ; Sun, 30 Jan 2011 00:58:49 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by mails3.awi.de (Postfix) with ESMTP id AF304D715E for ; Sun, 30 Jan 2011 00:58:47 +0100 (MET) X-Virus-Scanned: amavisd-new at awi.de Original-Received: from localhost ([127.0.0.1]) by localhost (mails3.awi.de [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id hTjRKUFWTuOF for ; Sun, 30 Jan 2011 00:58:40 +0100 (MET) Original-Received: from msg.awi.de (msg.AWI.DE [134.1.3.16]) by mails3.awi.de (Postfix) with ESMTP id C4E11D7152 for ; Sun, 30 Jan 2011 00:58:39 +0100 (MET) Original-Received: from [192.168.22.100] ([unknown] [91.61.47.53]) by msg.awi.de (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built Oct 15 2009)) with ESMTPSA id <0LFT000BV6LRWH00@msg.awi.de> for ntg-context@ntg.nl; Sun, 30 Jan 2011 00:58:39 +0100 (MET) X-Mailer: Apple Mail (2.1082) X-Bayes-Prob: 0.999 (Score 4.7, tokens from: @@RPTN) X-CanIt-Geo: ip=134.1.2.14; country=DE; region=03; city=Bremerhaven; latitude=53.5500; longitude=8.5833; http://maps.google.com/maps?q=53.5500,8.5833&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rE1zWM1w - f2d4fac6013a - 20110130 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:65629 Archived-At: Hi, I'm trying to insert the macro \pagerange into the code from texmf-context/tex/context/base/bibl-tra.mkiv but I'm quite lost. The macro should make proper page ranges from the bibtex file entries (Pages = {...}). That means remove any whitespace before and after the hyphen and double a single hyphen: 7-9 -> 7--9 1 - 3a -> 1--3a \def\pagerange#1% {\directlua{ range = string.gsub("#1", "\%s*[-\%s]+", "--") tex.sprint(range)}} Thanks for suggestions, Florian ___________________________________________________________________________________ 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 ___________________________________________________________________________________