Displaying snippets of code in Word for Mac 2011
Asked Answered
M

0

6

I would like to display code snippets (created in R) in a .docx file created in Word for Mac 2011 (which I am stuck with). I have tried inserting text boxes but they only display for the length of one page which makes editing difficult. Any suggestions?

P.S. I realize a similar question has been asked before regarding MS Word but none of the solutions seem to work for word for mac 2011.

Midst answered 5/9, 2012 at 12:17 Comment(3)
In what way do the previous solutions not work for you ? Why can you not just create a style in Word for code, which has a monospaced font and appropriate tabs, line spacing, etc ?Shakira
I suppose I could but that requires redoing the formatting (tabs) and also I wanted to display the code on a light grey background so that it is clear that it is code and looks nice.Midst
You can make the background colour part of the style. The tabs are a pain but you only have to set them up once. Alternatively just use spaces for indentation rather than tabs (just for the code, not for the rest of your document) - since it's monospaced this works well and is in general a better approach both for Word and for text editors, since tab sizes tend to be somewhat arbitrary.Shakira

© 2022 - 2024 — McMap. All rights reserved.