<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
The file boxes.mp adds the command <br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
save pic_;</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
to extra_beginfig. This seems likely to be the problem: drawunboxed ultimately makes use of pic_.<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
Also, extra_endfig has clearboxes added, which may also cause problems (although I don't really understand all that it does).
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
Cheers,<br>
</div>
<div>
<div style="font-family: "Courier New", monospace; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="3" face="Courier New">Daniel H. Luecking [luecking@uark.edu]
<br>
Department of Mathematical Sciences<br>
1 University of Arkansas<br>
Fayetteville, AR, USA 72701-1201</font><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> metapost <metapost-bounces+luecking=uark.edu@tug.org> on behalf of Laurence Finston <Laurence.Finston@gmx.de><br>
<b>Sent:</b> Tuesday, February 22, 2022 4:41 PM<br>
<b>To:</b> Metapost List <metapost@tug.org><br>
<b>Subject:</b> [metapost] Possible bug with boxit</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">In the attached MP file, I use macros from boxes.mp. It doesn't fail to call boxit outside of a figure, but it doesn't produce the expected result (at least, the one I expected): If I call it outside of a figure but not within the figure,
I get this error when I call drawunboxed:<br>
<br>
>> sproc_.C<br>
! Not a string.<br>
<to be read again><br>
(<br>
<for(C)> scantokens.sproc_(SUFFIX0)(<br>
(SUFFIX0)); ENDFOR<br>
fixsize->...$=(TEXT2):scantokens.sproc_$($);endfor<br>
.endgroup<br>
drawunboxed->fixsize((TEXT0))<br>
;fixpos((TEXT0));forsuffixes.s=(TEXT0):draw.pic...<br>
l.290 drawunboxed(C)<br>
;<br>
?<br>
<br>
If I call it outside the figure and then inside it, I get this error:<br>
<br>
! Redundant equation.<br>
<to be read again><br>
;<br>
boxit->...FIX2)sw)=ypart((SUFFIX2)se-(SUFFIX2)sw);<br>
0=xpart((SUFFIX2)ne-(SUFFI...<br>
l.273 boxit.C(V67)<br>
; %% boxit must be called here in order for drawunboxed...<br>
<br>
?<br>
<br>
If I call it in figure 0 and don't call it in the following figure (100), I get the following error when I call bpath in fig. 100:<br>
<br>
>> sproc_.C<br>
! Not a string.<br>
<to be read again><br>
(<br>
<for(C)> scantokens.sproc_(SUFFIX0)(<br>
(SUFFIX0)); ENDFOR<br>
fixsize->...$=(TEXT2):scantokens.sproc_$($);endfor<br>
.endgroup<br>
bpath->begingroup.fixsize((SUFFIX2))<br>
;fixpos((SUFFIX2));scantokens.pproc_(SUF...<br>
<to be read again><br>
;<br>
l.326 undraw bpath(C);<br>
<br>
?<br>
<br>
If I call boxit in both figures and not outside them, it works and the following two files are output:<br>
<br>
ttemp000.eps .. ttemp100.eps<br>
<br>
I didn't find any indication in mpboxes.pdf that the variables created by boxit would be local to an enclosing figure and I wouldn't have expected this behavior.<br>
<br>
Is this a bug?<br>
<br>
Thanks,<br>
<br>
Laurence<br>
</div>
</span></font></div>
</body>
</html>