Learn how to do code syntax highlighting in PowerPoint!

How to do code syntax highlighting in Microsoft PowerPoint

The basic technique I use to do syntax highlighting for my talk slides has two steps:

  1. open Visual Studio Code and write the code I want highlighted; and
  2. copy the code from Visual Studio Code directly to the PowerPoint slide.

I use this technique a lot when I'm preparing my talks! For an example of a whole presentation built with this technique you can check this slide deck.

Step-by-step instructions

To make it easier to follow, you can find here the step-by-step instructions. At the bottom of the page you'll also find an animated GIF showing you how I do this.

  1. Write some code in Visual Studio Code using the theme you already want:
Some Python code that has syntax highlighting in Visual Studio Code.
Some code in Visual Studio Code.
  1. Select the code and copy it:
Menu showing the “copy” option to copy the selected code.
Copying the selected code.
  1. Open PowerPoint (or the presentation you are working on):
Windows search showing Microsoft PowerPoint as the first result.
Opening PowerPoint.
  1. Paste the code into PowerPoint with the “Paste” menu button or with a keyboard shortcut:
PowerPoint menu showing the “paste” button.
Pasting the code.
  1. Your code should have syntax highlighting! Don't forget to change the font family, font size, among other things, if you need:
Code with syntax highlighting in Microsoft PowerPoint.
End result after pasting and resizing.

Pretty simple and saves you a LOT of trouble if you try to do syntax highlighting by hand... Which I did! It was painful. Finally, just because I can, here is the whole process in an animated GIF:

Animated GIF showing the process of preparing code with syntax highlighting in Microsoft PowerPoint.
Animated process.

That's it for now! Stay tuned and I'll see you around!

I hope you learned something new! If you did, consider following the footsteps of the readers who bought me a slice of pizza 🍕. Your small contribution helps me produce this content for free and without spamming you with annoying ads.

Previous Post Next Post

Blog Comments powered by Disqus.