From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/96054 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.comp.tex.context Subject: Re: Size of the last shipped page by Lua? Date: Wed, 7 Sep 2016 21:39:43 +0200 Message-ID: <57d06cfd.87941c0a.f7a78.f54e@mx.google.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2635879660747436197==" X-Trace: blaine.gmane.org 1473277224 23081 195.159.176.226 (7 Sep 2016 19:40:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 7 Sep 2016 19:40:24 +0000 (UTC) To: =?utf-8?Q?Proch=C3=A1zka_Luk=C3=A1=C5=A1_Ing.?= , ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 07 21:40:18 2016 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhihm-0005Sf-32 for gctc-ntg-context-518@m.gmane.org; Wed, 07 Sep 2016 21:40:18 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3E523174F0; Wed, 7 Sep 2016 21:39:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3a8bK4VolGiN; Wed, 7 Sep 2016 21:39:54 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 399CF1758B; Wed, 7 Sep 2016 21:39:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 56890174F0 for ; Wed, 7 Sep 2016 21:39:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mCYgoVtSQaiP for ; Wed, 7 Sep 2016 21:39:52 +0200 (CEST) Original-Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 96A2716B3B for ; Wed, 7 Sep 2016 21:39:42 +0200 (CEST) Original-Received: by mail-wm0-f44.google.com with SMTP id w12so51273788wmf.0 for ; Wed, 07 Sep 2016 12:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:mime-version:to:from:subject:date:importance:in-reply-to :references; bh=vHMzqGK5pzUKy+i0YP2X6rDfdRlFUcgq9L+GRSVQByA=; b=kJd2g4Tta5UtW/Vzs9l6fAMGe5VU2B4Egjj//3DkRGsdICXonfbTdcOEpgXnx2wZZI TVGfaXI9HN+y2Y3qbHFCF3UYd6qmU24YibX/9ZXAC/mkBaVFTKG4ZRqdmB9YSBnL5gGr DisAOIS1XyvrzxIQjEKZl2EJXXQFs9W1zHCDhB/q8Ha02k09UaiaqyeYNompEbqfPSlI DTrqHs0fTZxD29WQFpEBbRc1kzXAlc89JcGkc6QkjBsMCbSjvbbGjlxJTMwpOMMuU4Lv UR0hZG6V1DJ2vMG+dnnhVE/ESr+WMQ+yMxktRv87FbS3krUmSKZ4qtr8umr8fqdlHrcF 1YIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:mime-version:to:from:subject:date :importance:in-reply-to:references; bh=vHMzqGK5pzUKy+i0YP2X6rDfdRlFUcgq9L+GRSVQByA=; b=idJgIE0Tn4HJZGqzomCTtVkq3w8lTGAqT3o543OQJVvZK1Ms3IS7LWQEep4ogMag+U HLugp9a1/mNvVO2IQHIfTv6NmkmqEHd+Kz1tg8cNwDvbuCZDpFcmu9ZjIyyMZ6pdo3c3 H54f5MH9LbwMfaQRwDsp93DSAABndttgFskMUvG9gzGBn0rvulaFT5/x7p90GjP3hiyK EFz+MdFpf6/yDB2wUmlrRQpVckdYTAEdPFcX7CoL49Ra2w0MC2O595uboW/G/UcjTI2T DJXiQ8bpwKpvaPHhwnFLiMV6BV46jNLeUTAo6p3WzgiioVqiONFxnLRfmlO6SfNpkwgE vrnw== X-Gm-Message-State: AE9vXwNyhDNV77hf3c5sFRGbjQtfPM0RfvU/52ZZSzHB3ipIBcOHiMWccmvWA78tT1jJ3w== X-Received: by 10.194.242.67 with SMTP id wo3mr30939856wjc.65.1473277182071; Wed, 07 Sep 2016 12:39:42 -0700 (PDT) Original-Received: from ?IPv6:2a01:cb00:822:c400:9480:8ca6:d085:f4fe? (2a01cb000822c40094808ca6d085f4fe.ipv6.abo.wanadoo.fr. [2a01:cb00:822:c400:9480:8ca6:d085:f4fe]) by smtp.gmail.com with ESMTPSA id w129sm5789518wmd.9.2016.09.07.12.39.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 12:39:41 -0700 (PDT) Importance: normal X-Priority: 3 In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:96054 Archived-At: --===============2635879660747436197== Content-Type: multipart/alternative; boundary="_65E1DBAD-E8D4-4D7C-B612-198999AF31CE_" --_65E1DBAD-E8D4-4D7C-B612-198999AF31CE_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi, There are dimensions related to this=C2=A0: local paper_width =3D tex.getdimen('paperwidth') local paper_height =3D tex.getdimen('paperheight') There is also=C2=A0: tex.pageheight tex.pagewidth=20 Not sure these are always same. Hope this helps, Regards, Joseph Canedo De=C2=A0: Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing.= --_65E1DBAD-E8D4-4D7C-B612-198999AF31CE_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

Hi,

 = ;

There are dimensions related to this :=

 

local pa= per_width =3D tex.getdimen('paperwidth')

local pape= r_height =3D tex.getdimen('paperheight')

 = ;

There is also :

 

tex.pageheight<= /o:p>

tex.pagewidth

 

Not sure these are always sa= me. Hope this helps,

 

Regards,

&nb= sp;

Joseph Canedo

De : Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing.
Envoy= =C3=A9 le :mercredi 7 septembre 2016 17:12
=C3=80 : ConTeXt
Objet :[N= TG-context] Size of the last shipped page by Lua?

<= o:p> 

Hello,

 

is there a way to detect by L= ua what is the size (width and height) of the last shipped page?

 

Especially I'm inte= rested in the situation when page via \start/\stopTEXpage has been shipped,= like:

 

--= --

\startluacode

=C2=A0=C2= =A0 LastPageSize =3D function()

=C2=A0=C2=A0=C2=A0= =C2=A0 -- What to come here?

=C2=A0=C2=A0=C2=A0=C2= =A0 return w, h

=C2=A0=C2=A0 end

\stopluacode

 

\starttext

=C2=A0=C2=A0 \startluacode

=

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 local w, h =3D LastPage= Size()

 

= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 context("w=3D"..w .. ", h=3D&= quot; ..h) -- Should give "w=3D210mm, h=3D297mm" (or other units)=

=C2=A0=C2=A0 \stopluacode

=  

=C2=A0=C2=A0 \startTEXpage[with= =3D10cm,height=3D15cm]

=C2=A0=C2=A0 \stopTEXpage

 

=C2=A0=C2= =A0 \startluacode

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lo= cal w, h =3D LastPageSize()

 

=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 context("w=3D".= .w .. ", h=3D" ..h) -- Should give "w=3D100mm, h=3D150mm&quo= t; (or other units)

=C2=A0=C2=A0 \stopluacode

\stoptext

----

 

This would be very useful = when I need to insert a page of size of the last page to move to odd page w= hen A4 and A3 pages are mixed, to allow simple duplex printing on the print= er.

 

So - = how about 'LastPageSize()' function?

 

Best regards,

&nbs= p;

Lukas

 <= /o:p>

 

-- =

Ing. Luk=C3=A1=C5=A1 Proch=C3=A1zka | mailto:LPr@p= ontex.cz

Pontex s. r. o.=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn

Bezov=C3=A1 1658

147 14 Praha 4

 

Tel: +420 2= 41 096 751 (+420 720 951 172)

Fax: +420 244 461 038=

 

________= ___________________________________________________________________________=

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=C2=A0 : http:/= /www.pragma-ade.nl / http://tex.aanhet.net

archive= =C2=A0 : http://foundry.supelec.fr/projects/contextrev/

wiki=C2=A0=C2=A0=C2=A0=C2=A0 : http://contextgarden.net

_________________________________________________________________= __________________

 

= --_65E1DBAD-E8D4-4D7C-B612-198999AF31CE_-- --===============2635879660747436197== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============2635879660747436197==--