Skip to content

Instantly share code, notes, and snippets.

@deepak
Created March 20, 2014 02:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak/9655828 to your computer and use it in GitHub Desktop.
Save deepak/9655828 to your computer and use it in GitHub Desktop.
script to create RTF for code snippets to paste in keynote presentations using pygments
#!/bin/bash
# /usr/local/bin/pygmentize -f rtf -O "style=friendly,fontface=Courier Bold" "$1" | pbcopy
# /usr/local/bin/pygmentize -l ruby -f rtf -P style=presentation -P fontface="Source Code Pro" "$1" | pbcopy
/usr/local/bin/pygmentize -l ruby -f rtf -O "style=friendly,fontface=Source Code Pro" "$1" |
# Set the font size to 36pt (that's the \fs72 - RTF font sizes work in doubles)
sed "s/\\\\f0/\\\\f0\\\\fs72/g" |
# And copy. Enjoy!
pbcopy