How to save formatting when copying from gedit to an open office?

I edit octave files in gedit and it does a good job of highlighting them. However, when I try to copy and paste code in Open Office, it loses all formatting. Even when I try to insert> special, it still doesn't work.

Is there a way to do this without having to manually browse through all keywords that highlight keywords?

+4
source share
4 answers

The free and open-source KATE editor can actually export Octave HTML code while maintaining the correct syntax highlighting.

+3
source

I had the same problem and I found this very useful page: http://tohtml.com/ Therefore you do not need to install any other editor or material, just copy it to the page and let it do it.

PS: It seems that the owner likes to sell the domain, so I hope the project remains online, otherwise you will find other google solutions: "cpp online syntaxhighlighter"

+3
source

I don’t know if this might be good, but if you open the script using the Matlab® editor, you can make a copy and paste (paste> special) while maintaining the Octave syntax highlighting.

0
source

If you do not want to install KDE dependencies to run Kate, I have found a solution that can work until the Scite implementation in GNU / Linux (?) Receives the “Copy as RTF” command, see here

So release:

sudo apt-get install wine synapse 

wine: Windows emulator;)

synapse: quick application launch

download notepad ++ version for installation

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

install it! (with default values)

Now you can easily launch it using the synapse: if running: Ctrl + Space (or Super (window key) + Space ) and enter “notepad” (if not, press “Down arrow” and do a search!)

write the text, for example:

 for i=1:3 %comment! end 

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

insert it!

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

in Abiword works with Ctrl + V

0
source

Source: https://habr.com/ru/post/1303484/