Code snippet shall have spell-check disabled.Code snippet shall break across pages smoothly without any extra effort.Code snippet shall be inline with other text.Add code snippets to a word document, with syntax highlighting for easier visibility and differentiation of code and other text.Hopefully, the answer would be useful to someone. The post is longer than I would have liked, but I believe screenshots are always helpful. I am sharing the approach and my reasoning of why I chose this approach. However, I ended up using an entirely different approach which suited my needs. I recently came across this post and found some useful hints. Is there some better (and ideally portable) way to do this? Is there at least some sort of verbatim style similar to the LaTeX environment? Is there at least some pretty printer that I could copy-and-paste as RTF? My examples are primarily in Java.Īs someone who is used to LaTeX, doing this in Word is extremely painful. Some of the examples will be written from the IDE, and others would be written in place. I have to write some documents that will include source code examples.