Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

This question already has an answer here:

Is there a easy way to insert source code with highlight in Google Docs?

share|improve this question

marked as duplicate by Vidar S. Ramdal, Jacob Jan Tuinstra, Eight Days of Malaise, jonsca Apr 25 at 20:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 18 down vote accepted

Not directly but there is an easy way to do it.

You can use the online Colorer-take5 HTML generator to produce the highlighted code. Afterwards just copy/paste it into your document, but don't forget to change the font to Courier New and probably reducing the size of it and you're done.

Here is an example for Java code and using the Eclipse style: alt text

share|improve this answer
6  
Great idea, but I would suggest pygments.org to generate colored HTML (with multiple styles) and Consolas as font. –  schlamar Dec 12 '12 at 21:33

With the new Add-Ons for Google Drive, you can get code highlighting with the Code Pretty add-on.

share|improve this answer
    
This is a much better answer! –  jackocnr Sep 18 at 22:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.