0
$\begingroup$

How does one transform a table in Mathematica into one in MS Word?

$\endgroup$
  • $\begingroup$ mathematica.stackexchange.com/questions/22055/… $\endgroup$ – Alan Jun 9 '17 at 23:16
  • $\begingroup$ Hello, thank you it is better indeed. By copying as mathml, i can obtain a mathtype object in MS word and can modify the text. However, it is no longer a table in MS Word. I would have liked to obtain a MS Word table $\endgroup$ – Bendesarts Jun 10 '17 at 17:21
  • $\begingroup$ Perhaps export to an Excel file (Export["table.xls", data]), open that file in Excel, and copy-paste the table into Word? $\endgroup$ – jjc385 Jun 10 '17 at 20:00
2
$\begingroup$

The simplest way to copy the gridboxed table into the Word is right-click on it and choose a menu item "Copy as" -> "MathML". And paste it into the Word.

It will be inserted as table object: enter image description here

$\endgroup$
  • $\begingroup$ Hello, thank you it is better indeed. By copying as mathml, i can obtain a mathtype object in MS word and can modify the text. However, it is no longer a table in MS Word. I would have liked to obtain a MS Word table $\endgroup$ – Bendesarts Jun 10 '17 at 17:22
  • $\begingroup$ @Bendesarts, I know one more way but it is a bit more complicated. You can export the table from Mathematica to an Excel file and use it further in MS Office documents.. $\endgroup$ – Rom38 Jun 11 '17 at 9:56
  • $\begingroup$ ok and how do you do the exportation for Mathematica to an Excel file ? by copy the MAthematica table as plain text ? $\endgroup$ – Bendesarts Jun 11 '17 at 9:58
  • $\begingroup$ @Bendesarts, no, as usual: Export["file.xlsx",table], where the table is a variable name containing your table. It can be even not gridboxed.. You can lear more in help about export to xlsx format $\endgroup$ – Rom38 Jun 11 '17 at 15:03
1
$\begingroup$

The word "Table" may appear in Mma in different contexts.

If you are speaking about a table that can be obtained with, say, Grid, you may wrap it by Rasterize and then copy-paste it in Word.

This is an example of a table created in Mma:

lst2 = Table[i*j, {i, 1, 4}, {j, 1, 8}];
gr=Grid[lst2, ItemStyle -> {FontColor -> Red, FontSize -> 20}, 
 Dividers -> {{Directive[Green, Thickness[8]], 
    Directive[Green, Thickness[8]], None, None, None, None, None, 
    None, Directive[Green, Thickness[8]]}, 
    Directive[Blue, Thickness[5]]} , ItemSize -> {2, 3}];

and now the rasterized copy:

Rasterize[gr]

that can be copy-pasted into Word

enter image description here

Have fun!

$\endgroup$
  • 1
    $\begingroup$ thank you for you help. But, it doesn't help me. In fact, i look for a way such as i can copy/ paste the table into word but after i would like to have the possibility to modify the table in MS word. With this way, i copy into word a picture. But, i would like to copy a table where the values could be changed. $\endgroup$ – Bendesarts Jun 10 '17 at 13:22
1
$\begingroup$

Try this: In MMA, create a grid and display it using TraditionalForm. For instance,

Grid[ { { "a", "b", "c" }, { 1, 2, 3 },
    { x, y, z }  }  ] // TraditionalForm

Now highlight the displayed grid and use Ctl-C to copy the text to the clipboard.

In MS Word, click an empty part of the document where the table will be. Paste the clipboard into the document with the "Keep text only" option. This option will paste the text into the document with tab characters separating the columns. Finally, highlight the text and click on the Insert ► Table menu option. That will turn the tab-delimited text into a Word table.

This was tested with Mathematica 10.1, MS Word 2010 and Windows 7.

As noted by Alexey Popkov, this also works with Mathematica 8.0.4 and MS Word 2003 on Windows 7, but in Word 2003 one should choose the Table ► Insert ► Table menu item.

$\endgroup$
  • $\begingroup$ This also works with Mathematica 8.0.4 and MS Word 2003 on Windows 7 (but in MS Word 2003 one should choose the Table ► Insert ► Table menu item). $\endgroup$ – Alexey Popkov Jun 10 '17 at 23:57
  • $\begingroup$ @AlexeyPopkov Thanks for the comment. I added it to my answer. $\endgroup$ – LouisB Jun 11 '17 at 3:59

Your Answer

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

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