From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61803 Path: news.gmane.org!not-for-mail From: Johan Sandblom Newsgroups: gmane.comp.tex.context Subject: Re: Removing banner from mtxrun output Date: Tue, 21 Sep 2010 22:37:42 +0200 Message-ID: References: <20100921192856.GA32631@gaston.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1285101475 347 80.91.229.12 (21 Sep 2010 20:37:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Sep 2010 20:37:55 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 21 22:37:54 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 1Oy9b8-0007CH-93 for gctc-ntg-context-518@m.gmane.org; Tue, 21 Sep 2010 22:37:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 19296CA705; Tue, 21 Sep 2010 22:37:52 +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 5EVFtz3uv2Nk; Tue, 21 Sep 2010 22:37:48 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6C32DCA5E9; Tue, 21 Sep 2010 22:37:48 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 99B8FCA5E9 for ; Tue, 21 Sep 2010 22:37:47 +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 ZdzOvpvCjRx7 for ; Tue, 21 Sep 2010 22:37:45 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 37CD0CA58D for ; Tue, 21 Sep 2010 22:37:45 +0200 (CEST) Original-Received: from mail-gy0-f169.google.com (mail-gy0-f169.google.com [209.85.160.169]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8LKbhJX006127 for ; Tue, 21 Sep 2010 22:37:44 +0200 Original-Received: by gyf3 with SMTP id 3so2560525gyf.14 for ; Tue, 21 Sep 2010 13:37:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=IaYn4lA38iY5fsB31dKmw1+YtrZfIDDuY5eINpZgqJY=; b=oNjLZ8hSUqO2962+vb4iqolKaUmwOYBQEHt7+NoWzxqy/e9XaJiGuc3D+h9UphMM8k 9/dYbO51G66fxaTLxfYsRdWpgLIuJWCNu+N8oJxYOoomxzWwT32uwyj85XzHgpg33Hj9 avodX5wUtL1o2RzweyZWM0mhugu0ZLqDCgfOE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=hiZibY01Vx5nnrqoB7ZTCxqUbi/ow0299LjgXL1HDPALhXYgAL7/3LZOu6klYQPMpP /i25Xm0hnyPnhWXD9tzeVwfSmduaHA9zklJrYjmCOCHYhEMXmRza46QVFfmpK4hqZqGy iJhRX22GJjAhsrBLbf/o1aRGdQXUb7L1Ka+NI= Original-Received: by 10.220.127.37 with SMTP id e37mr5938963vcs.171.1285101462810; Tue, 21 Sep 2010 13:37:42 -0700 (PDT) Original-Received: by 10.220.184.72 with HTTP; Tue, 21 Sep 2010 13:37:42 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.160.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: 0dD9wBHoN - 7e984280d379 - 20100921 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:61803 Archived-At: Perfect, thank you. Johan 2010/9/21 Aditya Mahajan : > On Tue, 21 Sep 2010, Peter M=FCnster wrote: > >> On Tue, Sep 21 2010, Johan Sandblom wrote: >> >>> Is there a way to instruct >>> \typefile to ignore the last four lines of the outputfile? I assume >>> defining an alternative command which does just that is not too >>> difficult, but sadly beyond me. >> >> It seems, that it's not possible at the moment. There is a tracker item >> for this feature: http://tracker.luatex.org/view.php?id=3D475 > > Not hard to do, just no interface. We can change buffers.range so that it > accepts {1,-4} to mean from first to last-4 lines, and then just set > > =A0\typefile[lines=3D{1,-4}]{filename} > > In any case, it is easy to define a lua function that does this. > > \startluacode > > function buffers.stripfromend(name, count) > =A0 =A0local str =3D buffers.loaddata(name) > =A0 =A0if str and str~=3D "" then > =A0 =A0 =A0 =A0local lines =3D str:splitlines() > =A0 =A0 =A0 =A0local line, n, action =3D 0, 0, buffers.typeline > =A0 =A0 =A0 =A0local first, last, m =3D buffers.strip(lines) > =A0 =A0 =A0 =A0last =3D last - count > =A0 =A0 =A0 =A0m =A0 =A0=3D m - count > =A0 =A0 =A0 =A0for i=3Dfirst,last do > =A0 =A0 =A0 =A0 =A0 =A0n, line =3D action(lines[i], n, m, line) > =A0 =A0 =A0 =A0end > =A0 =A0end > end > \stopluacode > > \unprotect > \def\strippedtyping#1#2% count file > =A0{\begingroup > =A0 \tttf > =A0 \let\obs\specialobeyedspace > =A0 \ctxlua{buffers.stripfromend(\!!bs#2\!!es, #1)} > =A0 \endgraf > =A0 \endgroup} > \protect > > \starttext > > \strippedtyping{4}{filename} > > \stoptext > > To use this with t-filter, you can just say > > =A0 readcommand=3D\strippedtyping{4}, > > > Aditya > _________________________________________________________________________= __________ > 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 =A0: http://www.pragma-ade.nl / http://tex.aanhet.net > archive =A0: http://foundry.supelec.fr/projects/contextrev/ > wiki =A0 =A0 : http://contextgarden.net > _________________________________________________________________________= __________ > > -- = Johan Sandblom, MD PhD m +46735521477=A0 Sweden "What is wanted is not the will to believe, but the will to find out, which is the exact opposite" - Bertrand Russell ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________