How To Format A Block of Code Within a Presentation?

Syntax Highlightingopenoffice.orgGoogle DocsPresentation

Syntax Highlighting Problem Overview


I am preparing a presentation using Google Slides, though I can also work on the presentation within Open Office that will include code snippets.

Is there any easy way to perform basic syntax highlighting on the code snippets with either Google Docs or Open Office Presenter?

Edit: Since I believe that I can find a way to embed HTML, any tools that can perform syntax highlighting on HTML would also be welcome suggestions.

Syntax Highlighting Solutions


Solution 1 - Syntax Highlighting

An on-line syntax highlighter:

http://hilite.me/

Just copy and paste into your document.

Solution 2 - Syntax Highlighting

http://www.tohtml.com/ created syntax highlighted HTML code for lots of languages. It might be what you're looking for.

Solution 3 - Syntax Highlighting

If you're using Visual Studio (this might work in Eclipse also, but I never tried) and you copy & paste into Microsoft Word (or any other microsoft product) it will paste the code in whatever color your IDE had. Then you just need to copy the text out of word and into your desired application and it will paste as rich text.

I've only seen this work across Visual Studio to other Microsoft products though so I don't know if it will be any help.

Solution 4 - Syntax Highlighting

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

Solution 5 - Syntax Highlighting

I've also thought of this. Finally, my solution is to use github gist. Don't forget it also has highlight functionality. Just copy it. :)

Solution 6 - Syntax Highlighting

Just a few suggestions:

  • Screenshots might be an easy way, but you'll have to make sure the code in the image is big enough and clear enough to read. (not the whole screenshot, just the relevant part)
  • If you can embed html then there are lots of tools to generate syntax highlighted html.

Solution 7 - Syntax Highlighting

If you write your code in emacs then you might be interested in the htmlize elisp package.

Solution 8 - Syntax Highlighting

Check out http://codepad.org. It probably won't solve the poster's problem; but, I think it will be of use to others who read this article.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNoah GoodrichView Question on Stackoverflow
Solution 1 - Syntax HighlightingRobotEyesView Answer on Stackoverflow
Solution 2 - Syntax HighlightingrobintwView Answer on Stackoverflow
Solution 3 - Syntax HighlightingDan HerbertView Answer on Stackoverflow
Solution 4 - Syntax Highlightingrb195048View Answer on Stackoverflow
Solution 5 - Syntax HighlightingblueseaView Answer on Stackoverflow
Solution 6 - Syntax HighlightingvfilbyView Answer on Stackoverflow
Solution 7 - Syntax HighlightingrobintwView Answer on Stackoverflow
Solution 8 - Syntax HighlightingZackView Answer on Stackoverflow