How To Format A Block of Code Within a Presentation?

160,861

Solution 1

An on-line syntax highlighter:

http://hilite.me/

Just copy and paste into your document.

Solution 2

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

Solution 3

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

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

Solution 5

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. :)

Share:
160,861

Related videos on Youtube

Guram Savinov
Author by

Guram Savinov

I work for Lendio which helps small businesses find lending. While I have spent a lot of time as a full stack LAMPP programmer, my first love was data and databases. At present I get to spend all of my time at Lendio working on data architecture solutions, data quality, and helping data tell its story to our employees.

Updated on July 04, 2021

Comments

  • Guram Savinov
    Guram Savinov almost 3 years

    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.

    • Gelldur
      Gelldur almost 9 years
      If you copy from InteliJ products it will just work :)
    • Vladimir Mikulic
      Vladimir Mikulic over 3 years
      Check out Code Highlight add-on. It highlights a block of code in Slides presentation. Supports a wide variety of syntaxes (React, Vue, C++, Go etc.) & offers the most popular themes on the market (VS Code, Cobalt, One Dark etc.)
  • DrBeco
    DrBeco about 13 years
    The problem is what to do after that. I installed qt-source-highlight and got the HTML. But OOO Presentation doesn't seems to have an option to insert HTML, nor can I find some program to export the syntax with another option (like RTF for example). For windows, I found this answer: fauskes.net/nb/syntaxms But I'm using LINUX and oowriter doesn't have this option.
  • Ilia Choly
    Ilia Choly about 10 years
    Presentation no longer lets you add arbitrary html.
  • RobotEyes
    RobotEyes about 10 years
    @iliacholy You can just copy and paste the text from the preview box instead of using the HTML code
  • grasshopper
    grasshopper almost 10 years
    it would be cool if it also indented..
  • Some Noob Student
    Some Noob Student about 9 years
    Unfortunately, this only works for Doc and Spreadsheet and not Presentation, which is what the question is about.
  • CoffeDeveloper
    CoffeDeveloper about 9 years
    now it works also for presentation. They probably added the feature
  • Marson Mao
    Marson Mao almost 9 years
    Can't tweak colors of this add on...made it less useful
  • Erik Schierboom
    Erik Schierboom over 8 years
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
  • Zack
    Zack over 8 years
    This isn't an article, it is the link to a tool that may have some of the desired features. If the link changes and the tool becomes unavailable, the answer becomes irrelevant.
  • samu
    samu about 7 years
    @GameDeveloper how did yo umanage to get it working in presentations?
  • CoffeDeveloper
    CoffeDeveloper about 7 years
    Oh. it was a old comment. Who remember.. so much changed in 2 years. Maybe I copy pasted from another editor supporting markup. I really don't remember XD
  • galkin
    galkin over 5 years
  • Yaelz
    Yaelz over 5 years
    This service is unavailable
  • svichkar
    svichkar over 5 years
    Hey @RobotEyes! looks like the service is not available now
  • RobotEyes
    RobotEyes about 5 years
    I've added an alternative service
  • AndrewKS
    AndrewKS almost 3 years
    markup.su/highlighter is dead now, as well