0

I have a piece of code (e.g. a C or Java function) which I'm going to put in a presentation. I would like to have this code syntax-highlighted; but LibreOffice Impress (and MS Powerpoint) don't have this feature. And while other editors/IDEs do have it - it's only for internal display, not for copying elsewhere.

So, how can I achieve "persistent" syntax highlighting, producing something in a file or in the clipboard which I can copy/open in my office suite with the highlighting still visible?

Note: I'm on Linux.

Bonus points if:

  • The highlighting uses styles (e.g. you can change the color of all keywords by changing a document character style)
  • The solution supports adding line numbers as well.
einpoklum
  • 8,783
  • 20
  • 84
  • 153
  • 1
    This might be helpful https://stackoverflow.com/questions/387453/how-do-you-display-code-snippets-in-ms-word-preserving-format-and-syntax-highlig – Reddy Lutonadio Jun 09 '21 at 10:24
  • See also https://superuser.com/q/1525126/84724 – tohuwawohu Jun 09 '21 at 10:46
  • This also might help: https://community.notepad-plus-plus.org/topic/18976/syntax-color-config-export/5 or this: https://thisdavej.com/how-to-copy-visual-studio-code-with-syntax-highlighting-to-other-applications/ (Note that both Word and PowerPoint allow you to turn spell checking ... the red squiggles ... off) – Steve Rindsberg Jun 09 '21 at 19:11

0 Answers0