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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With