Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

When I add some text to a simple plot with drawing tools, the text cannot be copied and pasted out with the graphic itself to Microsoft Word.

Do you know how to copy the manually added text out to Word? Thank you!

This is what I did in Mathematica plot with drawing tool (I got this by output it as a .bmp file):

This is what was copied and pasted to Word (result of direct copy and paste):

After a few tries, I think it works for newly added text, but once I rotate & move the text to align with my curves it disappear again.

The following screenshot shows how bmp image lose resolution when the document coverted to PDF eventually.

The topic has been a little diverted. We still haven't solve the problem "copy & paste do not work for rotated text in plot". I think it's a MMA bug. Any hints?

share|improve this question
    
Do you have screen shots demonstrating the problem? –  rcollyer Sep 13 '12 at 4:41
    
Welcome to Mathematica.SE! Have you tried Rasterize-ing the graphics expression and pasting the resulting bitmap? –  Yves Klett Sep 13 '12 at 6:25
    
I had no problems doing this. Questions: what mma version? what OS? what text font? could you describe in detail how exactly you copy and paste? can you post code? –  Vitaliy Kaurov Sep 13 '12 at 6:46
    
@Vitaliy Kaurov I am running version 8.0.4 on windows XP. only changing the font do not cause problem. It is verified that the text rotation should be blamed. I use ctrl+c and ctrl+v to move the plot. The code itself dose not related to this question, which is related to the text added with "drawing tools". You can try rotating any text in any plot and see whether it paste to word or not. –  Xiaodong Wang Sep 13 '12 at 10:25
1  
You can export to higher Resolution or ImageSize. See e.g. How to export large graphics?. –  Yves Klett Sep 13 '12 at 11:34

2 Answers 2

Answer questions I posted in the comments to see if this is something system specific. @YvesKlett got a good suggestion. When you routinely copy/paste you let the OS to convert MMA graphics to image. To avoid any system-depended issues let MMA do it. This is how to do it completely interactively with keyboard and mouse:

  1. Click once on the graphics to see orange frame appear

  2. Drag corners of orange frame to desirable size/resolution

  3. Top menu >> Cell >> Convert To >> Bitmap

  4. Copy and paste

There are also programmatic ways with Export function.

share|improve this answer
    
"save as bmp" and import to word definetely works, I have used this way to get the first image in the question. What I am asking is why the "ctrl+c"-"ctrl+v" way dose not work for rotated text. P.s. the reason I prefer "ctrl+c"-"ctrl+v" than rasterized image is about the image resolution. My document will be printed as PDF eventually and the copy and pasted image is way clear than the bmp image. –  Xiaodong Wang Sep 13 '12 at 10:33
1  
@XiaodongWang I did not say "save as bmp" - in this workflow we are not saving anything, just ctrl+c/ctrl+v. We are avoiding OS conversion from graphics to image. –  Vitaliy Kaurov Sep 13 '12 at 10:36

It is much more natural to use the EMF vector format for such graphics which is natively supported by MS Office. You can use Export or the Save selection As... menu item to do export a graphics to this format.

Alternatively, you could convert your graphics into metafile an then copy it into the clipboard programmatically, then paste into Word. Here is reliable way to do this assuming that gr is your graphics (it works ONLY if one of the MS Office applications is currenly running):

nb = CreateDocument[ExpressionCell[gr /. _Tooltip -> Sequence[]], 
   Visible -> False, WindowSize -> {1672, 929}];
SelectionMove[nb, Next, CellContents];
FrontEndExecute[{FrontEndToken[nb, "SelectionConvert", "Metafile"], 
   FrontEndToken[nb, "Copy"]}];
NotebookClose[nb]; Clear[nb];

More information on the generating EMF graphics in Mathematica: "General PDF/EMF export problems and solutions."

EDIT

Quick experiments showed that outlined rotated text is exported to EMF somewhat distorted but probably it can be tuned to work fine. Just apply this oultining function to Rotated text:

outline = First@ImportString[ExportString[#, "PDF"], "PDF"] &;

Note that the reason for text size changes is related to the default setting for the PrintingStyleEnvironment $FrontEnd option.

share|improve this answer
2  
Thanks for reply, I have tried the code above but it still not work for rotated text. It's interesting to see that even save the plot to emf lose the rotated text! Could you please try it? –  Xiaodong Wang Sep 13 '12 at 11:06
1  
@Xiaodong I just tried exporting rotated text to EMF and got low-quality output. Export to SVG gives much better result but also distorted. Only export to EPS works as expected. You can directly embed the exported EPS into the Word document (I use Word 2003; it was reported that in subsequent versions of Word the EPS import was broken). –  Alexey Popkov Sep 13 '12 at 18:42
    
Thanks! Save as EPS works with high quality output in final PDF, except the font of the text is totally out of control. I am using word 2007.... –  Xiaodong Wang Sep 15 '12 at 15:08
    
@Xiaodong I am in sympathy with your in your sorrow. Somewhere in the comments on the linked page some (not elegant) workarounds for Office 2009 were suggested. But it seems that there is no workaround for Word 2007. I would suggest to install Word 2003 in parallel or on virtual machine. I have no problems with producing high-quality PDF files from Word documents with embedded EPS vector graphics from Word 2003 with latest updates. –  Alexey Popkov Sep 15 '12 at 16:04
    
Thanks for the link about word filters and appreciate for the curentlly only workable alternative. I think this thread is mainly focusing on the MMA bug: unrotated text in MMA's plots copy and pasted to word correctly, while rotated text cannot be pasted to word. This is definitely something wrong on MMA side. –  Xiaodong Wang Sep 17 '12 at 2:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.