Re: Including graphics in MP

[email protected] Thu, 18 May 2023 15:57:01 +0200
Newsgroups gmane.comp.tex.metapost
Message-ID <trinity-d37ca454-92ff-43ef-b395-ea8ae5ecfd32-1684418221694@3c-app-gmx-bs04>
--===============7478142180776982983==
Content-Type: text/html; charset=UTF-8

<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>At first glance it looks good, thank you.&nbsp; The documentation says it uses &#96;special&#39; commands in MP.&nbsp; That&#39;s what I was looking for in the MP manual but I had forgotten what it was called so my searches didn&#39;t turn anything up.&nbsp; Using exteps would probably be easier for me, since I don&#39;t know PS.</div>

<div>&nbsp;</div>

<div>Laurence</div>

<div>&nbsp;
<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b>&nbsp;Donnerstag, 18. Mai 2023 um 15:41 Uhr<br/>
<b>Von:</b>&nbsp;&quot;ALFREDO DE JESUS NAVARRO ROBLES&quot; &lt;[email protected]&gt;<br/>
<b>An:</b>&nbsp;&quot;[email protected]&quot; &lt;[email protected]&gt;, &quot;[email protected]&quot; &lt;[email protected]&gt;<br/>
<b>Betreff:</b>&nbsp;Re: [metapost] Including graphics in MP</div>

<div name="quoted-content"><!--P {
	margin-top: 0;
	margin-bottom: 0;
}
-->
<div>
<div class="elementToProof" style="font-family: Calibri , Arial , Helvetica , sans-serif;font-size: 12.0pt;color: rgb(0,0,0);">Perhaps it is this what you are looking for?</div>

<div class="elementToProof" style="font-family: Calibri , Arial , Helvetica , sans-serif;font-size: 12.0pt;color: rgb(0,0,0);">&nbsp;</div>

<div class="elementToProof ContentPasted1" style="font-family: Calibri , Arial , Helvetica , sans-serif;font-size: 12.0pt;color: rgb(0,0,0);"><a href="https://www.ctan.org/pkg/exteps" id="LPlnk793570" target="_blank">https://www.ctan.org/pkg/exteps</a></div>

<div class="elementToProof" style="font-family: Calibri , Arial , Helvetica , sans-serif;font-size: 12.0pt;color: rgb(0,0,0);">
<h1 class="ContentPasted0" style="margin-bottom: 0.4em;margin-top: 0.7em;padding: 0.2em 0.0px;font-size: 28.0px;line-height: 33.6px;font-family: Helvetica , Arial , Verdana , sans-serif;color: rgb(66,66,133);background-color: rgb(255,255,255);">exteps &ndash; Include EPS figures in<span class="ContentPasted0">&nbsp;</span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 25.2px;">METAPOST</span></h1>

<div class="left" style="margin-top: 1.0em;max-width: 65.0em;min-width: 15.0em;float: left;font-family: Helvetica , Arial , Verdana , sans-serif;font-size: medium;background-color: rgb(255,255,255);">
<p class="ContentPasted0" style="margin-bottom: 0.4em;margin-top: 0.3em;">&nbsp;</p>

<p class="ContentPasted0" style="margin-bottom: 0.4em;margin-top: 0.3em;">Exteps is a module for including external EPS figures into<span class="ContentPasted0">&nbsp;</span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 14.4px;">METAPOST</span><span class="ContentPasted0">&nbsp;</span>figures. It is written entirely in<span class="ContentPasted0">&nbsp;</span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 14.4px;">METAPOST</span>, and does not therefore require any post processing of the<span class="ContentPasted0">&nbsp;</span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 14.4px;">METAPOST</span><span class="ContentPasted0">&nbsp;</span>output.</p>
</div>
</div>

<div id="appendonsend">&nbsp;</div>

<hr style="display: inline-block;width: 98.0%;"/>
<div id="divRplyFwdMsg"><font color="#000000" face="Calibri, sans-serif" style="font-size: 11.0pt;"><b>De:</b> metapost &lt;[email protected]&gt; en nombre de [email protected] &lt;[email protected]&gt;<br/>
<b>Enviado:</b> jueves, 18 de mayo de 2023 10:31<br/>
<b>Para:</b> [email protected] &lt;[email protected]&gt;<br/>
<b>Asunto:</b> [metapost] Including graphics in MP</font>

<div>&nbsp;</div>
</div>

<div class="BodyFragment">
<div class="PlainText"><font size="2"><span style="font-size: 11.0pt;">Hello,<br/>
<br/>
Is it possible to include PostScript graphics, or literal PostScript in general, in MP files?<br/>
The purpose is to composite multiple images with correct alignment.<br/>
It&#39;s possible to do this in TeX (see below), but it would be nice to be able to do this directly in MP.<br/>
<br/>
I&#39;ve determined that this doesn&#39;t work:<br/>
<br/>
%prologues := 3;<br/>
%outputtemplate := &quot;%j_%c.ps&quot;;<br/>
<br/>
outputformat:=&quot;png&quot;;<br/>
outputformatoptions:=&quot;format=rgb antialias=none&quot;;<br/>
outputtemplate := &quot;%j_%c.png&quot;;<br/>
<br/>
verbatimtex &#92;input epsf etex;<br/>
<br/>
path q[];<br/>
<br/>
beginfig(1);<br/>
&nbsp; q0 = (unitsquare scaled 2cm) shifted (-1cm, -1cm);<br/>
&nbsp; draw q0 withpen pencircle scaled .333mm;<br/>
&nbsp; label(btex &#92;vbox{&#92;hbox{&#92;epsffile{testdot1.eps}}} etex, origin);<br/>
endfig;<br/>
end;<br/>
<br/>
It fails silently and the resulting PNG file is just a white square (see attachment).&nbsp; It doesn&#39;t work with EPS output, either.<br/>
<br/>
It does work to do this in TeX:<br/>
<br/>
&#92;input epsf<br/>
&#92;parindent=0pt<br/>
&#92;parskip=0pt<br/>
&#92;baselineskip=0pt<br/>
&#92;advance&#92;hoffset by -1in<br/>
&#92;advance&#92;voffset by -1in<br/>
&#92;nopagenumbers<br/>
&#92;def&#92;epsfsize#1#2{#1}<br/>
<br/>
&#92;vbox to 0pt{&#92;vskip2cm&#92;hbox to 0pt{&#92;hskip1cm<br/>
&#92;epsffile{testdot1.eps}&#92;hss}&#92;vss}<br/>
&#92;vbox to 0pt{&#92;vskip2cm<br/>
&#92;hbox to 0pt{&#92;hskip1cm&#92;epsffile{testdot2.eps}&#92;hss}&#92;vss}<br/>
&#92;vfil&#92;eject<br/>
&#92;bye<br/>
<br/>
The result is in &#96;testinclude.pdf&#39; (attached).<br/>
<br/>
Any help would be much appreciated.<br/>
<br/>
Laurence Finston</span></font><br/>
<br/>
<br/>
<br/>
<br/>
&nbsp;</div>
</div>
-- <a href="http://tug.org/metapost/" target="_blank">http://tug.org/metapost/</a></div>
</div>
</div>
</div>
</div></div></body></html>

--===============7478142180776982983==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

--
http://tug.org/metapost/

--===============7478142180776982983==--