2

My OS is Ubuntu 14.04, and I use MMA 10.

I export a figure ploted in MMA to a pdf file and then import the pdf in Latex, here is the screenshot odd

As you can see, the spacing in the text is odd. But it becomes normal if the length of each word is not too long.normal

So, how to fix this problem if there is a long word in the figure? How can I export it to a pdf file properly?

Here is the code to plot the figure

Plot[x, {x, 0, 1}, PlotLegends ->
  Placed[{"notethesaapa c in g"}, {Scaled[{0.9, 1.0}], {0.9, 1.0}}], 
  FrameLabel -> {None, None, "note the saapa c in g" , None},Frame -> True]

PS: I check in Windows and Mac OS, there is no probelm.

LCarvalho
  • 9,233
  • 4
  • 40
  • 96
Eden Harder
  • 1,145
  • 6
  • 22
  • 1
    Please tell us about your OS, your Mathematica version and provide a small code producing the issue. – Öskå Nov 26 '14 at 14:39
  • Why do not you insert a few additional empty intervals between the words "note", "the" and "saapa"? This seems the easiest, unless you have in mind a high-quality image as eg., for a journal publication. – Alexei Boulbitch Nov 26 '14 at 15:42
  • @Öskå Thanks! I update the quaestion. My OS is ubuntu 14.04 and I use MMA 10. – Eden Harder Nov 27 '14 at 01:33
  • @AlexeiBoulbitch It's just an example to show the problem. There are many long word in English, for example, 'smiles': there is a mile between two 's'. – Eden Harder Nov 27 '14 at 01:40
  • I tried your example in two ways at Mma 10.0, Win7. The first was to use the Menu/File/SaveSelectionAs, the second one to export the file. In the both cases I saved the files as pdf ones. I did not observe any fusion of the words in the FrameLabel. – Alexei Boulbitch Nov 27 '14 at 08:20
  • So the first image is a printscreen of the PDF and the second is a printscreen of Mathematica? Export["~/test.pdf", p] works fine for me on Fedora. – Öskå Nov 27 '14 at 11:49
  • @Öskå Yeap. Thanks! I use Export["~/test.pdf", p] with the same problem. So, it's a question of Ubuntu. – Eden Harder Nov 27 '14 at 12:05
  • @AlexeiBoulbitch Yes, I also tried on Windows with no problem. So, it may be only a question with Ubuntu. – Eden Harder Nov 27 '14 at 12:07
  • @EdenHarder Would it work with FrameLabel -> {None, None, "note" <> "\[ThinSpace]" <> "the" <> "\[ThinSpace]" <> "saapa" <> "\[ThinSpace]" <> "c" <> "\[ThinSpace]" <> "in" <> "\[ThinSpace]" <> "g", None}? – Öskå Nov 28 '14 at 13:24
  • @Öskå I'm sorry, nope. – Eden Harder Nov 28 '14 at 13:59
  • @EdenHarder Then I can't help :( I don't see anything else than this :) – Öskå Nov 28 '14 at 14:00
  • @Öskå Thanks all the same! – Eden Harder Nov 29 '14 at 02:54
  • Eden, does FrameLabel -> {None, None, Pane["note the saapa c in g"], None} work? – kglr Apr 27 '15 at 05:28
  • @kguler Thanks! not works. Everything is Okay in MMA, but the question occurs when export the figure to a pdf file. – Eden Harder Apr 27 '15 at 05:52
  • Can you specify the precise version of Mathematica you have? I cannot reproduce the problem with Mathematica 10.0.1 on Ubuntu 14.10. I couldn't try 10.0.2 or 10.1.0. – Szabolcs Apr 27 '15 at 14:31
  • 1
    @Szabolcs Thanks! Mathematica 10.0.0.0, Ubuntu 14.04. Maybe I should upgrade all of them. – Eden Harder Apr 28 '15 at 00:40
  • 1
    May be this approach can help? – Alexey Popkov Feb 16 '17 at 07:06

1 Answers1

0

I also noticed that the "Save Graphic As..." option doesn't work very well for exporting to PDF. Maybe try exporting to an image file type like png or jpg first and then convert to PDF with an external tool. Or simply print to PDF within Mathematica:

enter image description here

Kris
  • 543
  • 2
  • 10
  • Thanks!Print is not OK also. – Eden Harder Nov 27 '14 at 15:30
  • Are you interested in this because you want to import the graphics in a LaTeX document? If so, I could write a step-by-step guide on how to use the psfrag package to get LaTeX to render the text inside an imported image. – Kris Nov 27 '14 at 15:36
  • Yeap, you got me. Thanks so much! Even the coordinates in the axis will be mixed up when I export the figure as a eps file. – Eden Harder Nov 28 '14 at 01:46