Skip to content

Instantly share code, notes, and snippets.

@ept
Last active November 4, 2022 08:38
Show Gist options
  • Save ept/4475995 to your computer and use it in GitHub Desktop.
Save ept/4475995 to your computer and use it in GitHub Desktop.
Syntax highlighting code for PowerPoint (Mac OS)

How to add syntax-highlighted code to PowerPoint slides (Mac OS)

  1. pygmentize -f rtf FILE | pbcopy
  2. Paste into TextEdit (in rich text mode: Format → Make Rich Text before pasting), and copy to clipboard again.
  3. In PowerPoint, Edit → Paste Special… → Styled Text.

(Pasting RTF directly into PowerPoint doesn't work correctly, at least with PowerPoint 2008 — it extends colour spans longer than it should, and sometimes removes line breaks. Going via TextEdit seems to solve the problem.)

@Qi-Zhan
Copy link

Qi-Zhan commented Nov 4, 2022

It really helps me a lot!
and for current PPT you could skip step 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment