From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/68436 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: bug with showlayout Date: Mon, 16 May 2011 12:21:20 +0200 Message-ID: <4DD0FAA0.90801@wxs.nl> References: <4DD0EA3A.8070902@wxs.nl> <4DD0F1DF.2060003@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020901000204060305060307" X-Trace: dough.gmane.org 1305541323 4837 80.91.229.12 (16 May 2011 10:22:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 May 2011 10:22:03 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 16 12:21:54 2011 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 1QLuvt-0006v5-Lw for gctc-ntg-context-518@m.gmane.org; Mon, 16 May 2011 12:21:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3F148CACEF; Mon, 16 May 2011 12:21:48 +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 AZDseoNscBBs; Mon, 16 May 2011 12:21:45 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4E8A2CACF3; Mon, 16 May 2011 12:21:45 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AE6D5CACF3 for ; Mon, 16 May 2011 12:21:43 +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 Qt+qIz7T5cOL for ; Mon, 16 May 2011 12:21:32 +0200 (CEST) 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 F3FE7CACEF for ; Mon, 16 May 2011 12:21:31 +0200 (CEST) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p4GALVRn024105 for ; Mon, 16 May 2011 12:21:31 +0200 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 5.2a) with ESMTP id 100-1713362 for multiple; Mon, 16 May 2011 12:21:27 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 ThunderBrowse/3.3.5 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=11; city=Den Haag; latitude=52.0833; longitude=4.3000; http://maps.google.com/maps?q=52.0833,4.3000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06EIalv8S - b6c3f2605f1d - 20110516 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 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:68436 Archived-At: This is a multi-part message in MIME format. --------------020901000204060305060307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 16-5-2011 11:53, luigi scarso wrote: > On Mon, May 16, 2011 at 11:43 AM, Hans Hagen wrote: >> On 16-5-2011 11:30, Wolfgang Schuster wrote: >>> >>> Am 16.05.2011 um 11:20 schrieb luigi scarso: >>> >>>> but showing meta informations between \starttext \stoptext it's a bit >>>> strange. >> >> it's not meta-info ... it's typeset content > paperwidth, paperheight, bodyfontsize, the frames etc are meta-info of > the document yes, but they are *typeset* so we need to start the text first anyhow, the attached can make you happy i guesa ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- --------------020901000204060305060307 Content-Type: text/x-matlab; name="page-run.mkiv" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="page-run.mkiv" %D \module %D [ file=page-run, %D version=2000.10.20, %D title=\CONTEXT\ Page Macros, %D subtitle=Runtime Macros, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA / Hans Hagen \& Ton Otten}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. \writestatus{loading}{ConTeXt Page Macros / Runtime Macros} \unprotect \gdef\doshowprint[#1][#2][#3]% {\framed [\c!offset=\v!overlay, \c!strut=\v!no] {\forgetall \dontcomplain \globaldefs\minusone \dimen\zerocount\pagegoal \definepapersize[X][\c!width=4em, \c!height=6em]% \definepapersize[Y][\c!width=12em,\c!height=14em]% \setuppapersize[#1,X][#2,Y]% \setuplayout[#3]% \setbox\zerocount\vbox {\framed [\c!offset=\v!overlay,\c!strut=\v!no, \c!width=\paperwidth,\c!height=\paperheight] {\ss ABC\par DEF}}% \doublesidedfalse \def\cutmarklength{.5em}% \addpagecutmarks \zerocount \replicatepagebox\zerocount \scalepagebox \zerocount \mirrorpaperbox \zerocount \orientpaperbox \zerocount \centerpagebox \zerocount \mirrorprintbox \zerocount \orientprintbox \zerocount \offsetprintbox \zerocount \pagegoal\dimen\zerocount \box0}} \gdef\showprint {\dotripleempty\doshowprint} % \switchnaarkorps[8pt] % % \startcombinatie[4*4] % {\toonprint} {\strut} % {\toonprint[][][plaats=midden]} {\type{plaats=midden}} % {\toonprint[][][plaats=midden,markering=aan]} {\type{markering=aan}\break % \type{plaats=midden}} % {\toonprint[][][plaats=midden,markering=aan,nx=2]} {\type{markering=aan}\break % \type{plaats=midden}\break % \type{nx=2}} % {\toonprint[][][plaats=links]} {\type{plaats=links}} % {\toonprint[][][plaats=rechts]} {\type{plaats=rechts}} % {\toonprint[][][plaats={links,onder}]} {\type{plaats={links,onder}}} % {\toonprint[][][plaats={rechts,onder}]} {\type{plaats={rechts,onder}}} % {\toonprint[][][nx=2,ny=1]} {\type{nx=2,ny=1}} % {\toonprint[][][nx=1,ny=2]} {\type{nx=1,ny=2}} % {\toonprint[][][nx=2,ny=2]} {\type{nx=2,ny=2}} % {\toonprint[][][nx=2,ny=2,plaats=midden]} {\type{nx=2,ny=2}\break % \type{plaats=midden}} % {\toonprint[][][rugoffset=3pt]} {\type{rugoffset=.5cm}} % {\toonprint[][][kopoffset=3pt]} {\type{kopoffset=.5cm}} % {\toonprint[][][schaal=1.5]} {\type{schaal=1.5}} % {\toonprint[][][schaal=0.8]} {\type{schaal=0.8}} % \stopcombinatie % % \startcombinatie[3*4] % {\toonprint[liggend][][plaats=midden]} {\type{liggend}} % {\toonprint[][liggend][plaats=midden]} {\strut\break\type{liggend}} % {\toonprint[liggend][liggend][plaats=midden]} {\type{liggend}\break\type{liggend}} % {\toonprint[90][][plaats=midden]} {\type{90}} % {\toonprint[][90][plaats=midden]} {\strut\break\type{90}} % {\toonprint[90][90][plaats=midden]} {\type{90}\break\type{90}} % {\toonprint[180][][plaats=midden]} {\type{180}} % {\toonprint[][180][plaats=midden]} {\strut\break\type{180}} % {\toonprint[180][180][plaats=midden]} {\type{180}\break\type{180}} % {\toonprint[gespiegeld][][plaats=midden]} {\type{gespiegeld}} % {\toonprint[][gespiegeld][plaats=midden]} {\strut\break\type{gespiegeld}} % {\toonprint[gespiegeld][gespiegeld][plaats=midden]} {\type{gespiegeld}\break\type{gespiegeld}} % \stopcombinatie % maybe we will have page-run.lua \startluacode local function todimen(name,unit,fmt) return number.todimen(tex.dimen[name],unit,fmt) end local function showdimension(name) context.NC() context.tex(interfaces.interfacedcommand(name)) context.NC() context(todimen(name,"pt","%0.4fpt")) context.NC() context(todimen(name,"cm","%0.4fcm")) context.NC() context(todimen(name,"bp","%0.4fbp")) context.NC() context(todimen(name,"dd","%0.4fdd")) context.NC() context.NR() end local function showmacro(name) context.NC() context.tex(interfaces.interfacedcommand(name)) context.NC() context.getvalue(name) context.NC() context.NR() end local function reportdimension(name) commands.writestatus("layout",string.format("%-24s %12s %12s %12s %12s", interfaces.interfacedcommand(name), todimen(name,"pt","%0.4fpt"), todimen(name,"cm","%0.4fcm"), todimen(name,"bp","%0.4fbp"), todimen(name,"dd","%0.4fdd") )) end function commands.showlayoutvariables() if tex.count.textlevel == 0 then -- especially for Luigi: reportdimension("paperheight") reportdimension("paperwidth") reportdimension("printpaperheight") reportdimension("printpaperwidth") reportdimension("topspace") reportdimension("backspace") reportdimension("makeupheight") reportdimension("makeupwidth") reportdimension("topheight") reportdimension("topdistance") reportdimension("headerheight") reportdimension("headerdistance") reportdimension("textheight") reportdimension("footerdistance") reportdimension("footerheight") reportdimension("bottomdistance") reportdimension("bottomheight") reportdimension("leftedgewidth") reportdimension("leftedgedistance") reportdimension("leftmarginwidth") reportdimension("leftmargindistance") reportdimension("textwidth") reportdimension("rightmargindistance") reportdimension("rightmarginwidth") reportdimension("rightedgedistance") reportdimension("rightedgewidth") reportdimension("bodyfontsize") reportdimension("lineheight") else context.starttabulate { "|l|Tr|Tr|Tr|Tr|" } showdimension("paperheight") showdimension("paperwidth") showdimension("printpaperheight") showdimension("printpaperwidth") showdimension("topspace") showdimension("backspace") showdimension("makeupheight") showdimension("makeupwidth") showdimension("topheight") showdimension("topdistance") showdimension("headerheight") showdimension("headerdistance") showdimension("textheight") showdimension("footerdistance") showdimension("footerheight") showdimension("bottomdistance") showdimension("bottomheight") showdimension("leftedgewidth") showdimension("leftedgedistance") showdimension("leftmarginwidth") showdimension("leftmargindistance") showdimension("textwidth") showdimension("rightmargindistance") showdimension("rightmarginwidth") showdimension("rightedgedistance") showdimension("rightedgewidth") context.NR() showdimension("bodyfontsize") showdimension("lineheight") context.NR() showmacro("strutheightfactor") showmacro("strutdepthfactor") showmacro("topskipfactor") showmacro("maxdepthfactor") context.stoptabulate() end end function commands.showlayout() if tex.count.textlevel == 0 then commands.showlayoutvariables() else context.page() context.bgroup() context.showframe() context.setuplayout { marking = interfaces.variables.on } for i=1,4 do commands.showlayoutvariables() context.page() end context.egroup() end end \stopluacode \gdef\doshowframe[#1][#2]% {\ifsecondargument \setupbackgrounds [\v!page] [\c!frame=\v!on, \c!corner=\v!rectangular, \c!frameoffset=\!!zeropoint, \c!framedepth=\!!zeropoint, \c!framecolor=layout:page] \setupbackgrounds [#1][#2] [\c!background=, \c!frame=\v!on, \c!corner=\v!rectangular, \c!frameoffset=\!!zeropoint, \c!framedepth=\!!zeropoint, \c!framecolor=] \else\iffirstargument \showframe [\v!header,\v!text,\v!footer] [#1] \else \showframe [\v!top,\v!header, \v!text, \v!footer,\v!bottom] [\v!leftedge,\v!leftmargin, \v!text, \v!rightmargin,\v!rightedge] \fi\fi \setupbackgrounds [\c!state=\v!repeat]} \gdef\showframe {\dodoubleempty\doshowframe} \gdef\showsetups {\ctxcommand{showlayoutvariables()}} \gdef\showlayout % interfereert lelijk met een \typefile er na {\ctxcommand{showlayout()}} \gdef\showmargins {\starttabulate \NC asynchrone \NC \doifoddpageelse {odd} {even} \NC \NR \NC synchrone \NC \doifrightpageelse {right} {left} \NC \NR \NC right margin \NC \the\rightmarginwidth \NC \NR \NC left margin \NC \the\leftmarginwidth \NC \NR \NC outer margin \NC \the\outermarginwidth \NC \NR \NC inner margin \NC \the\innermarginwidth \NC \NR \stoptabulate} \protect \endinput --------------020901000204060305060307 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 ___________________________________________________________________________________ --------------020901000204060305060307--