Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I embed source code or HTML in Open Office Org Presentations without using screenshots?

I need to write a lot of class courses presentations to my programming class, and I constantly need to show source code (mainly C code).

enter image description here

I don't find a easy way to:

  1. Copy my source code from my editor (kate) and
  2. Paste it formated and with source highlighted to an Open Office Presentation (OOP).

What I use to do is a snapshot if the code is small, or to stop presentation and open Kate in the datashow if it is too big.

In this other question some suggest to embed HTML code. So I installed QSource-Highlight that easily convert C code to HTML (also gnu source-highlight, code2html, and so on). None of them can convert source code to a version of a highlighted RTF (rich text format), that would be another way to go.

Having HTML doesn't help, because I can't find a easy way to insert HTML into a presentation either. This site show a very trick windows solution. It needs to convert c code to HTML using an specific windows program that has an option to copy the HTML as RTF, after that you need to past the RTF in Word or Wordpad, and after that you special past RTF to PowerPoint. All good, but I'm a linux user, and I think there might be a better way.

Also, there is another possible solution, installing coooder extension to openoffice. I don't know why, but trying to install this extension in my system gives me an error. Synaptic tell's me that openoffice.org-core and a lot of other should be marked. I click next, and it tells me it wants to remove all the packages, and that coooder needs this packages to work, and so it is not going to be installed. Well...

I'm using linux UBUNTU 10.04, and Open Office 3.2

Thanks! Beco.

PS.: This question is debated in meta-so as possible duplication of the question cited above. But it is my understanding that the older question doesn't solve this specific problem.

PPS.: About the coooder bug, I've launched a bug report here


Edit (2015-08-19)

To insert a RTF text to presentation LibreOffice you can use menu insert, file, and rtf (or HTML).

like image 220
DrBeco Avatar asked Mar 31 '11 19:03

DrBeco


People also ask

What are the ways to access help system in Open Office presentation?

In the Window menu you can navigate between your open documents or open a new window, or close another window. The menu Help provides access to the different help functions.

How do I add a slide in open office?

Adding a new slideSelect Insert > Slide (works in Normal and Outline view). Right-click on the Slides pane and select New Slide from the pop-up menu (works in Normal, Outline and Notes view). Right-click on the main work area while in Slide Sorter view and select New Slide from the pop-up menu.


2 Answers

Some people says that copying code from Eclipse editor works well (UPDATE: Proven FALSE). Another alternative is exporting to RTF (can also export line numbers), or to clipboard, from Highlight and then opening/pasting it in OpenOffice.org. (UPDATE: Proven TRUE)

Here is a Highlight GUI screen shot: Highlight GUI (KDE)

You can also switch from OpenOffice.org to LibreOffice, and get COOoder from here.

like image 191
Francisco Alvarado Avatar answered Oct 05 '22 13:10

Francisco Alvarado


This answer is perfect for the job:

  • copy your code text to http://markup.su/highlighter/, and then
  • copy the formatted code back to Open Office.
like image 39
Daniel Reis Avatar answered Oct 05 '22 13:10

Daniel Reis