Syntax highlighting code in a word processor

How can I get syntax highlighted code in a word processor?

This is for a guide that will have code examples that should be able to go from page to page, so posting images is not an option.

I would prefer to do this with OpenOffice, but I could also use iWorks or Office. The code is Ruby, Java, Python, and possibly others. I could use TextMate to export if necessary.

+5
source share
5 answers

Xcode is already doing this, I think. If you copy it from a window and paste it into another application that accepts text with extended text, it will be formatted with it. I just took a screenshot:

screenshot http://img710.imageshack.us/img710/8756/xcodetextedit.png

+7
source

VIM has syntax that supports almost all programming languages, and has the ability to export hilighted source as an HTML file that should be easily imported by a word processor. Use

:TOhtml
+6
source

/ Java- Eclipse Word 2007 Word 2010, Paste, Paste Special- > Rich Text Format.

" " , "" .

+3

All Articles