From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/61802 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Removing banner from mtxrun output Date: Tue, 21 Sep 2010 16:18:42 -0400 (EDT) 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: MULTIPART/MIXED; BOUNDARY="8323328-1850979562-1285100329=:16752" X-Trace: dough.gmane.org 1285100334 27548 80.91.229.12 (21 Sep 2010 20:18:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Sep 2010 20:18:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 21 22:18:51 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 1Oy9Ig-0007yy-V2 for gctc-ntg-context-518@m.gmane.org; Tue, 21 Sep 2010 22:18:51 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E89A0CA6D8; Tue, 21 Sep 2010 22:18:49 +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 KdZ7Jt+lFI1b; Tue, 21 Sep 2010 22:18:47 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F396CCA69E; Tue, 21 Sep 2010 22:18:46 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A0638CA69E for ; Tue, 21 Sep 2010 22:18:45 +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 DBROdF3kp4D9 for ; Tue, 21 Sep 2010 22:18:34 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 14909CA5C2 for ; Tue, 21 Sep 2010 22:18:34 +0200 (CEST) Original-Received: from tombraider.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.12.86]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o8LKIW4l023356 for ; Tue, 21 Sep 2010 22:18:33 +0200 Original-Received: FROM web047053.wireless.mcgill.ca (web047053.Wireless.McGill.CA [142.157.47.53]) By tombraider.mr.itd.umich.edu ID 4C991315.E554C.32335 ; Authuser adityam; 21 Sep 2010 16:18:30 EDT In-Reply-To: <20100921192856.GA32631@gaston.couberia.bzh> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.12.86; 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: 0eD9wiwjP - 64e2ced379f1 - 20100921 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.219 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:61802 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-1850979562-1285100329=:16752 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE 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= =20 accepts {1,-4} to mean from first to last-4 lines, and then just set \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) local str =3D buffers.loaddata(name) if str and str~=3D "" then local lines =3D str:splitlines() local line, n, action =3D 0, 0, buffers.typeline local first, last, m =3D buffers.strip(lines) last =3D last - count m =3D m - count for i=3Dfirst,last do n, line =3D action(lines[i], n, m, line) end end end \stopluacode \unprotect \def\strippedtyping#1#2% count file {\begingroup \tttf \let\obs\specialobeyedspace \ctxlua{buffers.stripfromend(\!!bs#2\!!es, #1)} \endgraf \endgroup} \protect \starttext \strippedtyping{4}{filename} \stoptext To use this with t-filter, you can just say readcommand=3D\strippedtyping{4}, Aditya --8323328-1850979562-1285100329=:16752 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-1850979562-1285100329=:16752--