From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/115018 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gavin via ntg-context Newsgroups: gmane.comp.tex.context Subject: MetaFun manual's "texvar" is not working for me Date: Sat, 21 May 2022 07:12:54 -0600 Message-ID: <1FC42412-38AA-482A-994D-43A23F383741@comcast.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\)) Content-Type: multipart/mixed; boundary="===============4965101804714249136==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25473"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gavin To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat May 21 15:15:10 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nsOwo-0006Gn-GD for gctc-ntg-context-518@m.gmane-mx.org; Sat, 21 May 2022 15:15:10 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 48F4A28043A; Sat, 21 May 2022 15:14:21 +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 3wkdW3RlCeiR; Sat, 21 May 2022 15:14:19 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id EEB87289F45; Sat, 21 May 2022 15:14:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 311F82898A5 for ; Sat, 21 May 2022 15:14:18 +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 Aye86-IdPThi for ; Sat, 21 May 2022 15:14:16 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=96.102.19.35; helo=resqmta-c1p-024060.sys.comcast.net; envelope-from=gavinpublic@comcast.net; receiver= X-Greylist: delayed 61 seconds by postgrey-1.36 at zapf.ntg.nl; Sat, 21 May 2022 15:14:15 CEST Original-Received: from resqmta-c1p-024060.sys.comcast.net (resqmta-c1p-024060.sys.comcast.net [96.102.19.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id E930A28043A for ; Sat, 21 May 2022 15:14:15 +0200 (CEST) Original-Received: from resomta-c1p-022592.sys.comcast.net ([96.102.18.237]) by resqmta-c1p-024060.sys.comcast.net with ESMTP id sOo7nDNE7Lv9vsOusnykgz; Sat, 21 May 2022 13:13:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1653138790; bh=uN1m99s4X1kvnuSUQU/eUEOMuyp/G5RJvucIbikq3rk=; h=Received:Received:From:Content-Type:Mime-Version:Subject: Message-Id:Date:To; b=pws7Hd9ZmQL4rVNyhzuLcW23SNXgC9L3lA3U6lwAPCTeZHjl9QwyJBAOUFbXW6A/s TtL7OeF3L1O3pEL7+W4/6HeSWkdX7BV4Foo7q+lql1tlCB0uocjXAhFLEdwbr3PyrQ sCKB+3DayrnPJd5Qqhm/8SajVtBu5dwc+kQ3hM9sHnGDpOFUGfKvZuTH7deklTwsvK szGwE40lsaOoWIXVAuakIfZhpiIA6QscF5TQ2Fm70OJS+Pwz99FINh1W04dPvPttmg PgRW21YE2+F5yQ2dzQnivBCJ4Z+FIXOVj0n5GLmRcGTJbkqk98q0q9upe+cLMzdl4B uk5MDK0+8EWdg== Original-Received: from smtpclient.apple ([IPv6:2605:b40:14d0:ab00:b5d5:6475:cb85:54e8]) by resomta-c1p-022592.sys.comcast.net with ESMTPSA id sOudnJCctFWE2sOuinmhv4; Sat, 21 May 2022 13:13:05 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit X-Mailer: Apple Mail (2.3696.80.82.1.1) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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.io gmane.comp.tex.context:115018 Archived-At: --===============4965101804714249136== Content-Type: multipart/alternative; boundary="Apple-Mail=_61A8C835-480D-485E-82B9-7ED2E7BE9106" --Apple-Mail=_61A8C835-480D-485E-82B9-7ED2E7BE9106 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello list, I=E2=80=99m trying to reproduce the positional graphics examples in the = MetaFun manual on pp. 151-153. There are two examples of code for the = mpos:box. The first example uses \MPvar to retrieve variables set using = \setupMPvariables. This works fine. The second example uses texvar to = retrieve variables, but it does not work in the current LMTX. However, = the second example does work with my TeXLive install. I=E2=80=99ve put my working example below, with both versions of the = mpos:box code. Log output from a failed run is below that. Any ideas = where I might be going wrong? Thanks! Gavin \setupbackgrounds [page] [background=3D{backgraphics,foreground,foregraphics}] \defineoverlay [backgraphics] [\positionoverlay{backgraphics}] \defineoverlay [foregraphics] [\positionoverlay{foregraphics}] \setupMPvariables [mpos:box] [linecolor=3Dblue, linewidth=3D\linewidth, fillcolor=3Dlightgray, filloffset=3D2pt] %%%%%%%% This mpos:box works using \MPvar. %%%%%%% \startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidth} string tag; tag :=3D "\MPvar{self}" ; path box ; box :=3D positionbox(tag) ; box :=3D box enlarged \MPvar{filloffset} ; fill box withcolor \MPvar{fillcolor} ; draw box withcolor \MPvar{linecolor} withpen pencircle scaled \MPvar{linewidth} ; positioninregion ; \stopMPpositiongraphic %%%%%%% This mpos:box does not work using texvar. (log below) %%%%%%% %\startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidth} % path box ; box :=3D positionbox(texstr("self")) ; % box :=3D box enlarged texvar("filloffset") ; % fill box % withcolor texvar("fillcolor") ; % draw box % withcolor texvar("linecolor") % withpen pencircle scaled texvar("linewidth") ; % positioninregion ; %\stopMPpositiongraphic \starttext to get \hpos {A-0} {positions} sorted \startpositionoverlay{backgraphics} \setMPpositiongraphic{A-0}{mpos:box}{self=3DA-0} \stoppositionoverlay \stoptext system >=20 system > ConTeXt ver: 2022.05.11 11:36 LMTX fmt: 2022.5.20 = int: english/english system >=20 system > 'cont-new.mkxl' loaded open source > level 1, order 1, name = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkxl/co= nt-new.mkxl' system > beware: some patches loaded from cont-new.mkiv close source > level 1, order 1, name = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkxl/co= nt-new.mkxl' system > files > jobname './ContractionExperiments', input = './ContractionExperiments.tex', result './ContractionExperiments' fonts > latin modern fonts are not preloaded languages > language 'en' is active system > synctex functionality is enabled, expect 5-10 pct = runtime overhead! open source > level 1, order 2, name './ContractionExperiments.tex' fonts > preloading latin modern fonts (second stage) fonts > 'fallback modern-designsize rm 12pt' is loaded metapost > initializing instance 'metafun:1' using format = 'metafun' and method 'double' metapost > loading 'metafun' as 'metafun.mpxl' using method = 'double' metapost > initializing number mode 'double' metapost > trace > This is MPLIB for LuaMetaTeX, version 3.12, = running in double mode. metapost > trace >=20 metapost > trace > loading metafun for lmtx, including the plain = 1.004 base definitions metapost > trace >=20 metafun > log > metafun > log > error: Missing ')' has been inserted metafun > log > metapost > trace > , metapost > trace > paired -> -> = begingroup.if.pair(EXPR2):(EXPR2)else:((EXPR2),(EXPR2))fi.endgroup metapost > trace > , metapost > trace > llmoved -> -> = ((llcorner(EXPR0))shifted(-xpart.paired((EXPR1)),-ypart.paired((EXPR1)))) metapost > trace > { metapost > trace > -- -> -> {curl1}..{curl1} metapost > trace > enlarged -> -> = ((EXPR0)llmoved(EXPR1)--(EXPR0)lrmoved(EXPR1)--(EXPR0)urmoved(EXPR1)--(EXP= R0)ulmoved(EXPR1)--cycle) metapost > trace > ; metafun > log > metafun > log > I found no right delimiter to match a left one. = So I've put one in, behind the scenes; this may fix the problem. metafun > log > metapost > trace > path box ; box :=3D = positionbox(texstr("self")) ; box :=3D box enlarged texvar("filloffset") = ; fill box withcolor texvar("fillcolor") ; draw box withcolor = texvar("linecolor") withpen pencircle scaled texvar("linewidth") ; = positioninregion ; ; metapost > trace >=20 backend > xmp > using file = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkiv/lp= df-pdx.xml' pages > flushing realpage 1, userpage 1, subpage 1= --Apple-Mail=_61A8C835-480D-485E-82B9-7ED2E7BE9106 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 =
Hello list,

I=E2=80=99m trying to = reproduce the positional graphics examples in the MetaFun manual on pp. = 151-153. There are two examples of code for the mpos:box. The first = example uses \MPvar to retrieve variables set = using \setupMPvariables. This works fine. The second example uses = texvar to retrieve variables, but it does not work in the current LMTX. = However, the second example does work with my TeXLive install.

I=E2=80=99ve put my = working example below, with both versions of the mpos:box code. Log = output from a failed run is below that. Any ideas where I might be going = wrong?

Thanks!
Gavin


\setupbackgrounds
  = [page]
  = [background=3D{backgraphics,foreground,foregraphics}]
\defineoverlay [backgraphics] = [\positionoverlay{backgraphics}]
\defineoverlay = [foregraphics] [\positionoverlay{foregraphics}]

\setupMPvariables
  [mpos:box]
  = [linecolor=3Dblue,
  =  linewidth=3D\linewidth,
  =  fillcolor=3Dlightgray,
  =  filloffset=3D2pt]

%%%%%%%%  This mpos:box works using \MPvar. = %%%%%%%
\startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidth= }
  string tag; tag :=3D "\MPvar{self}" = ;
  path box ; box :=3D positionbox(tag) = ;
  box :=3D box enlarged =  \MPvar{filloffset} ;
  fill = box
    withcolor \MPvar{fillcolor} = ;
  draw box
  =   withcolor \MPvar{linecolor}
    = withpen pencircle scaled \MPvar{linewidth} ;
  = positioninregion ;
\stopMPpositiongraphic

%%%%%%%  This = mpos:box does not work using texvar. (log below) %%%%%%%
%\startMPpositiongraphic{mpos:box}{fillcolor,linecolor,linewidt= h}
%  path box ; box :=3D = positionbox(texstr("self")) ;
%  box :=3D box = enlarged  texvar("filloffset") ;
%  fill = box
%    withcolor texvar("fillcolor") = ;
%  draw box
%   =  withcolor texvar("linecolor")
%   =  withpen pencircle scaled texvar("linewidth") ;
%  positioninregion ;
%\stopMPpositiongraphic


\starttext

to get \hpos {A-0} {positions} sorted

\startpositionoverlay{backgraphics}
 =  \setMPpositiongraphic{A-0}{mpos:box}{self=3DA-0}
\stoppositionoverlay

\stoptext


system         =  > 
system         =  > ConTeXt  ver: 2022.05.11 11:36 LMTX  fmt: 2022.5.20 =  int: english/english
system     =      > 
system     =      > 'cont-new.mkxl' loaded
open = source     > level 1, order 1, name = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkxl/co= nt-new.mkxl'
system         =  > beware: some patches loaded from cont-new.mkiv
close source    > level 1, order 1, name = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkxl/co= nt-new.mkxl'
system         =  > files > jobname './ContractionExperiments', input = './ContractionExperiments.tex', result = './ContractionExperiments'
fonts     =       > latin modern fonts are not preloaded
languages       > language 'en' is = active
system         =  > synctex functionality is enabled, expect 5-10 pct runtime = overhead!
open source     > level 1, = order 2, name './ContractionExperiments.tex'
fonts =           > preloading latin modern fonts = (second stage)
fonts         =   > 'fallback modern-designsize rm 12pt' is loaded
metapost        > initializing = instance 'metafun:1' using format 'metafun' and method = 'double'
metapost        > = loading 'metafun' as 'metafun.mpxl' using method 'double'
metapost        > initializing number = mode 'double'
metapost       =  > trace > This is MPLIB for LuaMetaTeX, version 3.12, = running in double mode.
metapost     =    > trace > 
metapost   =      > trace > loading metafun for lmtx, including = the plain 1.004 base definitions
metapost   =      > trace > 
metafun =         > log >
metafun =         > log > error: Missing ')' has been = inserted
metafun         > = log >
metapost        > = trace > <to be read again> ,
metapost =        > trace > <macro> paired -> = <primary> -> = begingroup.if.pair(EXPR2):(EXPR2)else:((EXPR2),(EXPR2))fi.endgroup
metapost        > trace > <to = be read again> ,
metapost       =  > trace > <macro> llmoved -> -> = ((llcorner(EXPR0))shifted(-xpart.paired((EXPR1)),-ypart.paired((EXPR1))))<= /div>
metapost        > trace > = <to be read again> {
metapost     =    > trace > <macro> -- -> -> = {curl1}..{curl1}
metapost       =  > trace > <macro> enlarged -> -> = ((EXPR0)llmoved(EXPR1)--(EXPR0)lrmoved(EXPR1)--(EXPR0)urmoved(EXPR1)--(EXP= R0)ulmoved(EXPR1)--cycle)
metapost     =    > trace > <to be read again> ;
metafun         > log >
metafun         > log > I found no = right delimiter to match a left one. So I've put one in, behind = the
scenes; this may fix the problem.
metafun         > log >
metapost        > trace > = <direct> path box ; box :=3D positionbox(texstr("self")) ; box :=3D = box enlarged texvar("filloffset") ; fill box withcolor = texvar("fillcolor") ; draw box withcolor texvar("linecolor") withpen = pencircle scaled texvar("linewidth") ; positioninregion ; ;
metapost        > trace = > 
backend         > = xmp > using file = '/Users/Gavin/context-osx-arm64/tex/texmf-context/tex/context/base/mkiv/lp= df-pdx.xml'
pages         =   > flushing realpage 1, userpage 1, subpage = 1
= --Apple-Mail=_61A8C835-480D-485E-82B9-7ED2E7BE9106-- --===============4965101804714249136== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============4965101804714249136==--