Ask Your Question

What is the best way to include source code / program listings in Writer? [closed]

asked 2013-08-08 19:12:21 +0100

user0365364 gravatar image

updated 2020-08-18 13:08:59 +0100

Alex Kemp gravatar image

I would like to include some source code into an appendix at the end of my document. Is there any way of doing this?

I thought perhaps screen-shot the code and crop and paste it in... Obviously that is a silly thing to do and it doesn't look professional. Is there another way?

I also tried pasting in code and formatting it with the monospace font. That looks okay, but there is no syntax highlighting. Is syntax highlighting a possibility? Or am I asking too much?

PS: Code is in C / C++

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-06 04:49:29.637488


Textbox way to insert code snippets in word document.

• Insert > Text Box

• Create a textbox size by mouse (this is resizeable later)

• Click at any size of the text box, from properties menu, select fill > colour > choose a colour

• Click the text box, select a font colour

• Start typing

• Finally it should look something like this:-

fr0xk gravatar imagefr0xk ( 2018-04-04 07:55:05 +0100 )edit

1 Answer

Sort by » oldest newest most voted

answered 2013-08-08 22:18:50 +0100

carnendil gravatar image

updated 2013-08-08 22:19:25 +0100

The LibreOffice extension center lists a few resources that might help you with this task.

I haven't used any of these, but with a quick search I was able to find the following extensions:

  1. Code Colorizer Formatter, which shows a warning because it has not had an update in over a year.

  2. COOoder.

Of course, you can always develop your own solution and contribute it[PDF] to the catalogue!

edit flag offensive delete link more



I got a strange error with COOoder, which failed to install, but Code Colorizer Formatter seems to be working well, even if it is a bit old - still works find as far as I can tell.

Thanks for the suggestion!

user0365364 gravatar imageuser0365364 ( 2013-08-10 01:48:19 +0100 )edit

Question Tools



Asked: 2013-08-08 19:12:21 +0100

Seen: 51,084 times

Last updated: Aug 08 '13