Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code with syntax highlighting in a word processor [closed]

How can I get code with syntax highlighting into a word processor?

It's for a manual that will have code examples which should be able to go from page to page so putting images is not an option.

I'd rather do it with OpenOffice but I could also use iWorks or Office. The code is Ruby, Java, Python and maybe others. I could use TextMate to export it if necessary.

like image 485
pupeno Avatar asked Dec 16 '09 22:12

pupeno


People also ask

How do I insert a code into a Word document?

Go to the Insert tab, click the Object drop-down arrow, and pick “Object.” On the Create New tab, select “OpenDocument Text” as the Object Type. Click “OK.” A new Word document will open for you to insert your code or command.

How does syntax highlighting change the program?

Syntax highlighting also helps programmers find errors in their program. For example, most editors highlight string literals in a different color. Consequently, spotting a missing delimiter is much easier because of the contrasting color of the text.


1 Answers

XCode does that already, I think. If you copy out of its window and paste into another app that accepts rich text, the formatting comes along with it. I just made a screenshot:

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

like image 68
Carl Norum Avatar answered Nov 03 '22 12:11

Carl Norum