From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/37499 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Images centered on page Date: Fri, 23 Nov 2007 19:00:48 +0100 Message-ID: <20071123190048.1bf3c43a.schuster.wolfgang@googlemail.com> References: <688772575.20071123185537@gmail.com> 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: ger.gmane.org 1195840900 11651 80.91.229.12 (23 Nov 2007 18:01:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Nov 2007 18:01:40 +0000 (UTC) Cc: mailing list for ConTeXt users , Yatskovsky To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 23 19:01:47 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1IvcqX-0004xT-Gp for gctc-ntg-context-518@m.gmane.org; Fri, 23 Nov 2007 19:01:45 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E4E6A1FD60; Fri, 23 Nov 2007 19:01:30 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 28965-05-3; Fri, 23 Nov 2007 19:01:23 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DE0841FDDB; Fri, 23 Nov 2007 19:01:21 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D2DA21FD75 for ; Fri, 23 Nov 2007 19:01:10 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04389-02-3 for ; Fri, 23 Nov 2007 19:01:02 +0100 (CET) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by ronja.ntg.nl (Postfix) with ESMTP id B219F1FD3B for ; Fri, 23 Nov 2007 19:00:53 +0100 (CET) Original-Received: by nf-out-0910.google.com with SMTP id b2so2608118nfb for ; Fri, 23 Nov 2007 10:00:53 -0800 (PST) Original-Received: by 10.86.100.7 with SMTP id x7mr9731277fgb.1195840853323; Fri, 23 Nov 2007 10:00:53 -0800 (PST) Original-Received: from rover ( [194.94.240.58]) by mx.google.com with ESMTPS id d6sm2860179fga.2007.11.23.10.00.52 (version=SSLv3 cipher=OTHER); Fri, 23 Nov 2007 10:00:52 -0800 (PST) In-Reply-To: <688772575.20071123185537@gmail.com> X-Mailer: Sylpheed 2.4.7 (GTK+ 2.10.14; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:37499 Archived-At: On Fri, 23 Nov 2007 18:55:37 +0200 Vyatcheslav Yatskovsky wrote: > Hello, > > How can I center the image on a page? I want images to cover the page completely, and since they have proper size (roughly A4), I only need them to be centered. Now they are stuck to the top, leaving a gap on bottom (and same for left-right). > > I have the following script (note my Lua trick to process images in a batch). Image names are "Image00001.png" and so on. > > > %engine=luatex > \setuplayout > [footer=0mm, header=0mm, > topspace=0mm, backspace=0mm, > leftmargin=0mm, rightmargin=0mm, > location=middle, > height=fit, width=fit] > > \starttext > > \startluacode > for n = 1, 9 do > tex.print(string.format("\\externalfigure[Image%05d.png]", n)); > end > \stopluacode > > \stoptext \def\fivedigits#1% {\ifnum#1<10000 0\ifnum#1<1000 0\ifnum#1<100 0\ifnum#1<10 0\fi\fi\fi \fi\number#1} \dorecurse{9} {\startTEXpage[width=210mm,height=297mm] \centeredbox{\externalfigure[Image-\fivedigits\recurselevel]} \stopTEXpage} Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________