4
$\begingroup$

When I used Mathematica 9, I used to Export to .eps using a .pdf Export, followed by import like the following:

ClearAll[x, o, esub, rproj, sn3]
x = {4, 2};
o = {0, 0};

bold = Style[#1, Bold] &;
esub = Subscript[bold["e"], #1 ] &;
rproj = Row[{esub[#1]}] &;
sn3 = Graphics[{Thick, Arrow[{o, x}, {0, 0.15`}]
   , Text[rproj[1], x/2, Background -> White]
   }, Frame -> True]

Export[ "out.eps", sn3]
Export["outFromPdf.eps",
 First[ImportString[
   ExportString[sn3, "PDF", "AllowRasterization" -> False,
    Background -> None], "PDF"]]]

This was to reduce the size of the generated .eps file, since Mathematica generated .eps files that were so large that they used to crash the latex suite. I have a version 11 trial installed, and see that this export, import trick garbles the image in some cases. For example the direct export to .eps looks like:

direct export to eps

whereas the Export/Import'ed image looks like:

indirect export

Notice how the numbers on the axes get garbled after this transformation.

Does anybody know why the image gets garbled with this Export/Import cycle?

I'm not sure if the eps size issue that Mathematica 9 used to have is now fixed. It may be improved, perhaps enough that the answer is to just not do this conversion cycle. In this particular case, the direct exported .eps file is 6x larger, but it's still only 60K, and I seem to recall seeing numbers in the megabytes for direct export before.

$\endgroup$
  • $\begingroup$ I don't get the boxes with versions 11.0.1 and 11.1.0 on Windows 7 x64 even if I add "TextOutlines" -> False to ImportString. It looks like you are on Mac, so probably this problem is OS specific. $\endgroup$ – Alexey Popkov Mar 19 '17 at 6:31

Your Answer

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

Browse other questions tagged or ask your own question.