Hi, Florent.

On Jun 29 2007, Florent Rougon wrote:
> Rogério Brito <[EMAIL PROTECTED]> wrote:
> > Which steps did you actually use? I'm curious. I tried to grab
> > metapost-fail.pdf and include it with \includegraphics (with the
> > graphicx package loaded) and I got a blank place where the square
> > should have appeared, unfortunately. :-(
> 
> pdfTeX is able (thanks to Hans Hagen) to include MetaPost output files.
> You don't need (and shouldn't) convert them to PDF beforehand.

Thank you very much. I didn't know that I shouldn't convert them
beforehand. I just assumed that they were regular Encapsulated
Postscript files and that I could such conversions.

> Just give them the extension .mps and graphicx will do the rest.
(...)

It works wonderfully. Thanks for the hint! Now, my workflow is quite
simplified.

> > What exactly did you use to convert the picture to PDF? If I
> > remember correctly, epstopdf crashes with a problem of ghostscript.
> 
> Don't convert the picture. Unless you use the prologues variable, output
> files from MetaPost are incomplete PostScript files (something about the
> fonts is missing), so the conversion is not straightforward. BTW, I
> suppose that the .mps extension means "MetaPost PostScript" precisely to
> remind us that these are not really PostScript files.

Indeed, they lack the fonts. Did you notice that the generated output
comes with the math fonts embedded many times, when used this way? And
one thing that is quite noticeable is that the fonts embedded in the PDF
file normally have names in all caps, like CMR10, while the fonts used
by these figures have names like cmr10.

> > Oh, it just occurred me that the versions of ghostscript that we may
> > be using may be the culprit.
> 
> I didn't use gs at all here.

Right.

> > But I am not exactly shure, unfortunately. Any light shed on this issue
> > would be *quite* welcome.
> 
> I'm pretty sure it's not a MetaPost problem. BTW, it is IMHO clumsy to
> require the setting of TEX to "latex" for your MetaPost documents to
> compile. Other documents may well require TEX=tex, so you would have to
> fiddle with the env var depending on the document. Bleh. Personally, I
> declare the use of LaTeX where it belongs, i.e. in the .mp file, like
> this:

Indeed, this is a much cleaner way. I was reading the manpage of mpost
and included %&latex *before* verbatimtex. It didn't work. Now,
putting it after verbatimtex as you indicated, mpost doesn't bomb while
I compile my graphics.

BTW, I'm trying to migrate from graphics drawn by tools like xfig to
graphics described by MetaPost, since they are much cleaner.

> I'm also attaching a typical Makefile I use whose purpose is to:
(...)

Thank you very much for the Makefile. I also have one Makefile (much
simpler than yours) and I also put all the figures in a figs
subdirectory of the document.

> HTH.

It indeed helped a lot, but I still have one problem, even with the
automatic inclusion of MetaPost files in pdflatex: xpdf doesn't show the
little square that it is supposed to show.

I'm beginning to suspect that the problem may be with xpdf. Of course,
xdvi doesn't show the labels in LaTeX, since it invokes gs. :-(

With gv on the PDF file, it actually draws a very, very light square (I
have to pay attention very hard on my screen to actually see it). It
doesn't seem as black as the triangle or the other numbers included in
the picture.

Ah, one more thing: other instances of this very same square *is* quite
visible on the text (as expected), but this square is not visible. It
must have something to do with it being in a picture... :-(

Do the triangle and the square look "as black" as each other in your
screen? I have not tried printing my text (it is part of an ongoing text
for my students), but I suspect that it will appear "light", if printed
from the PDF file.


Anyway, thank you very much for your very helpful hints, Rogério Brito.

-- 
Rogério Brito : [EMAIL PROTECTED] : http://www.ime.usp.br/~rbrito
Homepage of the algorithms package : http://algorithms.berlios.de
Homepage on freshmeat:  http://freshmeat.net/projects/algorithms/

Reply via email to