code highlighter Code Highlighter

This extension highlights the code snippets over 350 languages in LibreOffice.

★ ★ ☆ ☆ ☆
Calc Extensions Impress Writer
Download latest

latest release: 2020-03-05 22:50:06


To highlight a code snippet, follow these steps:

  1. Insert a new Text Box (Insert -> Text Box)
  2. Copy and paste/write your code snippet into the text box (You can choose any fonts based on your preference)
  3. Select the text box
  4. Go to Tools -> Highlight Code -> <Language of the code>

That's it. Your code should be colored based on the syntax.

I have tested only a few languages. If you find any bugs, please report them at GiHub Issues.

Note: This extension uses pygments to color the code. Pygments does not highlight some languages properly. Therefore, you may not get the best outcome for some languages. Sorry for the inconvenience.


Requirements (Close all LibreOffice products before installing these dependencies):

  • Python 3
  • python3-pygments
  • libreoffice-script-provider-python (May be optional)

Ubuntu and its derivatives users can install the dependencies using the following commands:

sudo apt install libreoffice-script-provider-python python3-pip
sudo pip3 install pygments

Windows users can install the dependencies using the following commands:

pip3 install pygments

Mac users can install it by following the instructions given at


Windows requires the environment variable: PYTHONPATH pointing to: C:\Users\<UserName>\AppData\Local\Programs\Python\Python<PythonVersion>\Lib\site-packages

You may face Scripting Framework error in your system. It happens if LibreOffice is using a different (most probably an internal package) Python. Please check the following Git Hub issues to resolve them.

Additional documentation:


Release List

Release Description Compatibility Operating Systems License Release notes   1.6 Include a dialog to select custom styles 4.0 Linux, Windows, macOS GPL Download 1.5 Fix script error in highlighting text selection in LO Impress 4.0 Linux, Windows, macOS GPL Download 1.4 Release 1.4 4.0 Linux, Windows GPL

Release 1.4

Download 1.3 Support C++ 4.0 Linux, Windows, macOS GPL

Support C++

Download 1.2 - Support automatic language detection
- Long list of languages are categorized into submenus
4.0 Linux, Windows, macOS GPL Download 1.1 Fixed error when coloring Yaml 4.0 Linux GPL

The pygments' language lexers and styles have some conflicting tokens which caused to runtime errors in this extension. Such bugs are fixed in this release.

See GitHub issue #5

Download 1.0 Code Highlighter 1.0
379 Languages
Tested with LO
4.0 Linux GPL

Supports 379 languages

Tested with LibreOffice Writer, Calc and Impress

Tested languages:

  • Java
  • Python
  • C
Show more


★ ★ ☆ ☆ ☆

Post your review

You cannot post reviews until you have logged in. Login Here.


  • Fabian Jun 3, 2020, 1:27 AM (4 years ago)

    ★ ☆ ☆ ☆ ☆

    Seems not to work under LibreOffice
    Installation runs fine, but it keeps throwing errors when I'm trying to use it.

  • Jim May 28, 2020, 4:47 AM (4 years ago)

    ★ ☆ ☆ ☆ ☆

    Tried to download and kept getting this error.
    Failed to register package for$UNO_USER_PACKAGES_CACHE/uno_packages/lu11512q61hem.tmp_/ea4db15f_codehighlighter.oxt/python

    • Gael Langlais Feb 1, 2021, 3:54 PM (3 years ago)

      Hi Jim,

      The following did it for my:
      sudo apt-get install python3-pip
      sudo -H pip3 install --system pygments
      sudo apt install libreoffice-script-provider-python

RSS feed for reviews on this page | RSS feed for all reviews