From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80521 Path: news.gmane.org!not-for-mail From: Marco Pessotto Newsgroups: gmane.comp.tex.context Subject: Re: arranging vs. \page[last] Date: Tue, 29 Jan 2013 08:00:27 +0100 Message-ID: <87wquwtqwk.fsf@universe.krase.net> References: <4FAB5D33-DDE5-4A87-9C51-6684541F34BA@fiee.net> <57411B45-0663-4F46-9329-260FF117F85D@gmail.com> <560AAA44-22D7-4702-AFB6-5C083E402AD1@fiee.net> 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 1359443564 3470 80.91.229.3 (29 Jan 2013 07:12:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Jan 2013 07:12:44 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Tue Jan 29 08:12:58 2013 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 1U05NJ-0007nk-02 for gctc-ntg-context-518@m.gmane.org; Tue, 29 Jan 2013 08:12:57 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D285310205; Tue, 29 Jan 2013 08:12:36 +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 wJZnEOcT-9wC; Tue, 29 Jan 2013 08:12:35 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 595CE101F5; Tue, 29 Jan 2013 08:12:35 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B2FF3101F5 for ; Tue, 29 Jan 2013 08:12:34 +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 1JhR9wFY5cSy for ; Tue, 29 Jan 2013 08:12:33 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id 95F80101E5 for ; Tue, 29 Jan 2013 08:12:33 +0100 (CET) Original-Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0T7CUCN006296 for ; Tue, 29 Jan 2013 08:12:32 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U05N7-0007jI-MD for ntg-context@ntg.nl; Tue, 29 Jan 2013 08:12:45 +0100 Original-Received: from 93-137-212-1.adsl.net.t-com.hr ([93.137.212.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jan 2013 08:12:45 +0100 Original-Received: from melmothx by 93-137-212-1.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 29 Jan 2013 08:12:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 74 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 93-137-212-1.adsl.net.t-com.hr User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:gk15I3vTDIAKUAaWiXUO6Gu7qdI= X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.3; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0NIRHcumv - 8487bf654c7c - 20130129 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:80521 Archived-At: Mari Voipio writes: > On Mon, Jan 28, 2013 at 10:17 PM, Henning Hraban Ramm wrote: >> >> What would you suggest to put something onto the last (i.e. back) page? > > The wiki has a trick, but I think it stopped working at some stage - > maybe somebody can fix it (if it is broken): > http://wiki.contextgarden.net/Imposition#Getting_the_last_page_of_a_Booklet > > (Obviously we aren't the only ones with this problem...) > I use the following code (luatex only). \startusercode function fillsignature(pages) -- skip the cover pages = pages - 2 local originalpages = pages --set needed pages to 0 local neededpages = 0 local modulo = pages % 4 if modulo ~= 0 then neededpages = 4 - modulo end if neededpages ~= 0 then global.texio.write_nl('term and log', "Here I added " .. neededpages .. " pages") tex.print("\\dorecurse{" .. neededpages .. "}{\\page[empty]}") else global.texio.write_nl('No page needed!') end end \stopusercode \define[1]\fillthesignature{ \usercode{fillsignature(#1)}} \define\bookletclosing{ \fillthesignature{\the\realpageno} \page[empty]} \setuppapersize[A5][A4,landscape] \setuparranging[2UP] \setuppagenumbering[alternative=doublesided] \starttext \dorecurse{10}{ \input knuth \page[yes] \input knuth } \bookletclosing This is the last page \stoptext Best wishes -- Marco ___________________________________________________________________________________ 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 ___________________________________________________________________________________