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!

Thanks for reading โค๏ธ

If you enjoyed this blog article, you will love the mathspp insider ๐Ÿ๐Ÿš€ newsletter! Join +16.000 others who are taking their Python ๐Ÿ skills to the next level! ๐Ÿš€

Previous Post Next Post

Blog Comments powered by Disqus.