I've have a Word document that I'd like to import to Mathematica. I could just copy and paste, but when I do, I lose the underlined text. Is there a way to get MS Word text into Mathematica while preserving the underlining of words.
$\begingroup$
$\endgroup$
3
-
$\begingroup$ whats you goal, formatted text in text cells? $\endgroup$– george2079Commented Jul 25, 2016 at 16:23
-
$\begingroup$ @george2079 I'm have underlined text that's important in a giant text file, and I want to simply isolate the underline text and use Mathematica functions on them. So yes, if the formatted text in the text cells had say, [Underlined]...Text...[/Underlined], isolating the underlined text, then yes. $\endgroup$– Sham SaysCommented Jul 25, 2016 at 18:03
-
$\begingroup$ You can try saving as an RTF file and then importing. I bet from there you can answer your own question. $\endgroup$– chuyCommented Jul 25, 2016 at 18:59
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
You can transfer styled text from Word to Mathematica using an intermediate file rich-text format (.rtf). Here is how.
- In Mathematica create an empty text cell (Cmnd+7 in OS X). Do not move the insertion point out of this cell.
- In Word, select the text you want to copy and save as an .rtf file. I don't use Word, so I don't know if you do selection save or a selection export, but I'm pretty sure one or other is available because RTF is a Microsoft format.
- Go back to Mathematica and choose File... from the Insert menu. In the system file open dialog that appears, choose the .rtf file you just made and open it.
- You should now see your text with most of its formatting preserved. Underlined words will certainly be preserved.