4

Does anyone out there have a cute way of previewing images generated by MetaPost? As far as I can tell, after making the .mp file there is a bit a process for viewing the file. I figure there aught to be an easy script to write that would convert the .mp file to a .pdf, and then open the .pdf with Adobe, or something along those lines, but I lack the ability to write BASH code, or even know the proper terminology to use to talk about such scripts. (BASH code, shell scripts... Something)

Edit: I forgot to mention, I was looking for such a script that would run automatically after compiling in TexMaker. Again, I assume there must be a way to do such a thing, but I don't know how. I want to be able to click the "MPost" build option, and then see a preview, without needing to go through the trouble manually running the conversion command.

  • 1
    You mean, like mptopdf? Note that one complication is that there need not be a one-to-one mapping from .mp to .pdf, so the situation is rather unlike the usual .tex case. (There need not be such a mapping there either but there usually is. That's not so for an .mp file.) – cfr Mar 22 '15 at 21:12
  • Try the \convertMPtoPDF command... – Malipivo Mar 22 '15 at 21:16
  • @Malipivo Is that a command in the document, or in the command line? I found the command that converts them, but I want something that will open up the document as soon as I build it in TexMaker- looking at my post I see I omitted that. Let me append to my question. – user41692 Mar 22 '15 at 21:32
  • If you are on Mac OS X, there are the very handy Perl scripts of Nicola Vitacolonna (based on mptopdf, but much more friendly) for previewing MetaPost programs: users.dimi.uniud.it/~nicola.vitacolonna/home/software/…. They were devised for TeXShop, but they can be run from any Unix command line, and so they should be compatible with any editor which can launch external tasks. I don't know about their compatibility with Windows. – Franck Pastor Mar 22 '15 at 21:34
  • I'm using Ubuntu, should it still work? – user41692 Mar 22 '15 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy