Tuesday, March 27, 2012

Creating a presentation for showing source code

Giving a presentation which has source code fragments has never been easy.

Normally, I have been pasting code fragments in an OpenOffice presentation. The effort in getting it right has been sufficiently irritating that I try to avoid it.

I finally used a process which I found very convenient.

1. Use vim :TOhtml command to get color coded source code. It was even easier using gvim.

2. Open the html file in OpenOffice. Change the font size to 16.

3. Create a new OpenOffice text document. Choose page size as A5 and landscape orientation.

4. Copy paste the fragments. Add comments, etc. Edit like a normal text document.

5. Export it to pdf.

6. Show it using the presentation mode in evince or  okular.




No comments:

Post a Comment