DEV Community

Omayeli Arenyeka
Omayeli Arenyeka

Posted on

How do you include code examples in talks? (e.g slides) How can you add syntax highlighting?

Top comments (6)

Collapse
 
yellzheard profile image
Omayeli Arenyeka

also recently found this: carbon.now.sh/

Paste some code in and it syntax highlights it and fakes a terminal window for screenshots.

Collapse
 
rapasoft profile image
Pavol Rajzak

I usually do code examples in separate editor, e.g. IntelliJ IDEA supports presentation mode, where the editor window is maximized and has large font.

This is also more interactive and immersive, you can change the code snippet or directly run it.

If I want to show some code in the slides, I usually do a screenshot from editor :). It's definitely easier than pasting and formatting the code in presentation software.

Collapse
 
yellzheard profile image
Omayeli Arenyeka

Yeah I was thinking of screenshots too but didn't know if there were any caveats. Thank you!

Collapse
 
shaunakpp profile image
Shaunak Pagnis • Edited

I Copy/Paste as RTF from my editor. Most editors have features and/or plugins to allow content to be copied in the Rich Text Format which retains most of your formatting, including syntax highlighting.

Here are a few plugins for some popular editors:

  1. Atom
  2. Sublime Text
  3. Vim
  4. Emacs

I've used this quite effectively in my slides. You can refer this talk for example.

Collapse
 
yellzheard profile image
Omayeli Arenyeka

thank you! Will take a look!

Collapse
 
fnh profile image
Fabian Holzer

At university I did most of my slides with LaTeX beamer, nowadays I prefer to use reveal.js - both come with a plugin for syntax highlighting, so i basically copy and paste the code into the slide deck and let the framework do its magic.