Back to Blog
How to copy text formatting in word7/6/2023 ![]() Just in case someone else looks for this question.Īnother way to have all the source code in a word document with a good-looking format using RStudio is to use the File/Compile Notebook option, choosing MS Word as the output format. ![]() ![]() This can then be pasted into MS Word with HTML format. When your script is correctly highlighted in Notepad++ go to the "Plugins > NppExport > Copy HTML to clipboard" menu to copy the open file. (Or copy and paste from RStudio to Notepad++, but make sure you set the file's language-from the "Language" menu-to R). ![]() From RStudio, save your script (with a ".R" extension) then open the script in Notepad++. But there is a copy-and-paste-and-copy-and-paste solution. If you are pasting from the script editor, then you're out of luck with a direct copy-and-paste solution. There should be an option for "HTML Format" that will do what you need (though you may need to resize the font to make everything fit properly depending on your page margins). If you are pasting from the console-please check "Paste special" again. It's not totally clear whether you are pasting from RStudio's script editor (which has some 4 or 5 colors) or from the R console (script + output) within RStudio (which only has 2 colors).
0 Comments
Read More
Leave a Reply. |