Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently wrote a repport for school with a lot of code in it. The only way I found to wrok was to highlight it with STRONG and that is really quite ugly. So is there a code highlightning extension for libre office writer?

Like this one below:

<insert code here>

A syntax highlight with different colors is also ok.
I never enter a whole program so I need to be able to highligt what I think is code.

Like this one: echo "Hello World!";


I presonally didn't like this highlight since it formats the text and all the text that comes after. I want to mark some text then click on a highlight and that's it.
This one is too complicated and hard to use, I have to select programming language each time I highlight which will be about 100 times in one report, that's way too much.
I would like something similar to what they use on the site. simple code highlight if you will.

Code Colorizer Formatter

It installs for me, but I can't get it to work and it doesn't have PHP or HTML support, which I need.

share|improve this question
added as an answer, glad it helped –  Drake Clarris May 29 '13 at 14:10
I recommend using LaTeX (see example). Before I've used latex, I saved the source as HTML with KDE Kate and copied the rendered code from a browser to open office –  moose Jun 3 '13 at 12:51
@Moose why do you add this as a comment instead of an answer? explain all the steps too thanks. –  Alvar Jun 3 '13 at 19:31

3 Answers 3

up vote 7 down vote accepted

It's not a plug-in, but I put the code into a website that colors syntax for you. The site I use is tohtml. I don't use the html generated code however, I just copy the colored and highlighted code from the browser and paste it into my document and WYSIWYG.

share|improve this answer

Try cooder. From the cooder website:

"Coooder is a syntax highlighting extension for Writer. It is a port of the GeSHi engine to LibreOffice, so it handles all the languages GeSHi can handle. It also creates styles for each colorized elements to easily change the colours to what suits you best."

To use cooder (adapted from the post: Documentation for Using Coooder Extension by cloph):

  • Highlight the source code that you want to format.
  • From the LO Writer menu select ToolsAdd-OnsCOOoder
  • In the window that appears, select the programming language.

The Documentation for Using Cooder Extension by cloph also contains instructions for displaying the optional Coooder toolbar.

share|improve this answer

One that I know of, but seems to be abandoned, is Code Colorizer Formatter.

I don't know if it still works in LO 4, but it might be worth for you to give it a try (or to rescue and bring up to date!).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.