5

I am editing octave files in gedit, and it does a nice job highlighting them. However, when I try to copy and paste the code into Open Office, it loses all formatting. Even when I try paste > special, it still doesn't work.

Is there any way to do this without having to manually go through all my code highlighting keywords?

Adam
  • 61
  • 2
  • 3

4 Answers4

3

I had the same problem and I found this very usefull page: http://tohtml.com/ So you don't need to install any other editor or stuff, just copy paste to the page and let it do it.

PS: It seems like the owner likes to sell the domain, so hopefully the project will stay online, otherwise you will find other solutions google: "cpp online syntaxhighlighter"

Karl Adler
  • 15,780
  • 10
  • 70
  • 88
3

The free and open source editor KATE can actually export in HTML Octave's code keeping the correct syntax highlighting.

ignucius
  • 31
  • 2
0

I don't know if this can be any good, but if you open the script with the Matlab® editor, then you can make copy and paste (paste > special), keeping the Octave syntax highlighting.

Emiliano
  • 1
  • 1
0

If you don't want to install KDE dependencies for run Kate I found a solution that could work until Scite implementation in GNU/Linux (?) haven't got the command "Copy as RTF", take a look here

So let's go:

sudo apt-get install wine synapse

wine: Windows Emulator ;)

synapse: fast application launcher

download notepad++ installer version

go to Downloads, chmod +x executable file (permissions to execute, could do graphically with properties of file, in permissions)

install it! (with default values works)

now you can run it easily with synapse: if is launched: Ctrl+Space (or Super (windows key)+Space) and type "notepad" (if no appear, press Arrow Down and search it!)

write a text in, for example:

for i=1:3
  %comment!
end

and now select it, with right button of mouse "plugin commands > copy text with syntax highlighting"

paste it!

in LibreOffice Writer: be carefull, use Ctrl+Shift+V or Edit>Paste Especial>Formated Text [RTF]

in Abiword works with Ctrl+V

Florent
  • 12,310
  • 10
  • 49
  • 58
Pedro
  • 1
  • 1