My new ebook “Comprehending Comprehensions” is on pre-sale and 40% off!

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!

Espero que tenhas aprendido algo novo! Se sim, considera seguir as pisadas dos leitores que me pagaram uma fatia de pizza 🍕. O teu pequeno contributo ajuda-me a manter este projeto grátis e livre de anúncios aborrecidos.

Artigo anterior Próximo artigo

Blog Comments powered by Disqus.