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. The documentation says it uses `special' commands in MP. That's what I was looking for in the MP manual but I had forgotten what it was called so my searches didn't turn anything up. Using exteps would probably be easier for me, since I don't know PS.</div> <div> </div> <div>Laurence</div> <div> <div> <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> Donnerstag, 18. Mai 2023 um 15:41 Uhr<br/> <b>Von:</b> "ALFREDO DE JESUS NAVARRO ROBLES" <[email protected]><br/> <b>An:</b> "[email protected]" <[email protected]>, "[email protected]" <[email protected]><br/> <b>Betreff:</b> 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);"> </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 – Include EPS figures in<span class="ContentPasted0"> </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;"> </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"> </span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 14.4px;">METAPOST</span><span class="ContentPasted0"> </span>figures. It is written entirely in<span class="ContentPasted0"> </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"> </span><span class="mflogo ContentPasted0" style="font-family: MFLogo , sans-serif;font-size: 14.4px;">METAPOST</span><span class="ContentPasted0"> </span>output.</p> </div> </div> <div id="appendonsend"> </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 <[email protected]> en nombre de [email protected] <[email protected]><br/> <b>Enviado:</b> jueves, 18 de mayo de 2023 10:31<br/> <b>Para:</b> [email protected] <[email protected]><br/> <b>Asunto:</b> [metapost] Including graphics in MP</font> <div> </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'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've determined that this doesn't work:<br/> <br/> %prologues := 3;<br/> %outputtemplate := "%j_%c.ps";<br/> <br/> outputformat:="png";<br/> outputformatoptions:="format=rgb antialias=none";<br/> outputtemplate := "%j_%c.png";<br/> <br/> verbatimtex \input epsf etex;<br/> <br/> path q[];<br/> <br/> beginfig(1);<br/> q0 = (unitsquare scaled 2cm) shifted (-1cm, -1cm);<br/> draw q0 withpen pencircle scaled .333mm;<br/> label(btex \vbox{\hbox{\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). It doesn't work with EPS output, either.<br/> <br/> It does work to do this in TeX:<br/> <br/> \input epsf<br/> \parindent=0pt<br/> \parskip=0pt<br/> \baselineskip=0pt<br/> \advance\hoffset by -1in<br/> \advance\voffset by -1in<br/> \nopagenumbers<br/> \def\epsfsize#1#2{#1}<br/> <br/> \vbox to 0pt{\vskip2cm\hbox to 0pt{\hskip1cm<br/> \epsffile{testdot1.eps}\hss}\vss}<br/> \vbox to 0pt{\vskip2cm<br/> \hbox to 0pt{\hskip1cm\epsffile{testdot2.eps}\hss}\vss}<br/> \vfil\eject<br/> \bye<br/> <br/> The result is in `testinclude.pdf' (attached).<br/> <br/> Any help would be much appreciated.<br/> <br/> Laurence Finston</span></font><br/> <br/> <br/> <br/> <br/> </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==--