How to copy a code with syntax


#1

Forgive me for the bad grammar. I use google translator.

I would like to copy the code into Word with the syntax of what is in the Atom.
Copy to have been colored words.
How to copy and paste this is normal black text.
I would like to make this text is colored as in the Atom.
It does not have to be exactly as in the Atom. It may be similar syntax. No matter which way but I have colored text in Word.

The code I have written to the Arduino, and the syntax is objective-c.

How do I copy with colored text?


#2

When Atom copies text from the editor, it only copies it as plain text. It doesn’t copy formatted text. So there isn’t a way to copy the syntax highlighted, formatted text from Atom.


#3

omitting Atom. Is there a way to copy the code into Word, including syntax? No matter from where. It may be some forum with wbydowanym editor Syntax.
How to do it?


#4

You can copy formatted text from a web page and paste it into a rich text editor and some formatting will be preserved, yes.


#5

people listen. The fact that I have a problem and do not know how to do it does not mean that I have not tried. IM not stupid.
Such things checked. Give normal solutions.
As you do not have anything interesting is not contagious.


#6

Why not copy the code into Word and then color it?


#8

There’s no reason to paste code into Word. Just go into the Ace editor, paste your code, and press Print.


#9

You could use an online syntax highlighter like one of those.
https://tohtml.com/
http://hilite.me/
http://highlight.hohli.com/

That will generate a web page with colored code that can be copy / paste to word.

Also as noted on this page, you may have a better luck sharing formatting with Microsoft Word if using a Microsoft browser (internet explorer or edge) (I did not have any problem with firefox, but it may depend on platform/version of the different software used)


Exporting atom files with colours
#10

finally a sensible answer. thanks


#11

copy-as-rtf works well for me. The syntax highlighting isn’t exactly what I have but it does a pretty good job and is simple to use.