Is it possible to embed programming source code to Powerpoint slide, and keep code highlighting/coloring?
11 Answers
If the source code does not need to be copied and pasted out of the presentation, a quick and dirty solution could be to simply take screenshots of the source code.
- 1,401
Here's another approach:
- Find an online source code syntax highlighting service.
- Paste the code to highlight into the web site.
- Copy the highlighted version.
- Create a new Word document.
- Paste the code into Word (note the background colours may be lost).
- Copy the code from Word.
- Create a new text area in PowerPoint.
- Click the Home menu option.
- Open Paste on the ribbon.
- Select Keep source formatting.
- Optionally, change the text area background colour to taste.
Adjust the font using Inconsolata or other monospace font.
- 3,427
- Click on Insert → Object → OpenDocument Text
- Paste on opened panel
- Click outside.
Note: Copying from Notepad++ will preserve colors and styling.
- 15,201
- 131
Copy the code and first paste that code into Microsoft word
Then do the formatting if necessary and then copy from word and paste back to powerpoint by right clicking and choosing use destination theme
- 121
Using Notepad++ and Npp Export works great, but your text will end up with a white background.
To remove it, paste first the text in word with the "preserve source formatting" option. Then, select the text and in Home > Font, remove the background with the Text Highlight Color option.
Then, copy again the text from word, and paste it in powerpoint with the "preserve source formatting" option.
- 21
Online syntax highlighter like TextMate seems good as well, http://markup.su/highlighter/
But after pasting into PowerPoint presentation new lines and line spacing is lost, so we can take a screen shot of the preview and paste it in our PowerPoint presentation
I've had no success pasting into Powerpoint 2010 on Windows.
However, pasting from Eclipse into Word 2010 works.
You can then save this formatted text as an RTF file, then embed the RTF into a Powerpoint 2010 slide using Insert Object (and optionally select 'link' so you can edit and update the text in Word).
- 196
Pasting from Eclipse should retain formatting if the app supports it. I know Word does... not sure about PPT.
- 7,258


