Answer the question
In order to leave comments, you need to log in
How to format program code (C++) in Microsoft Word?
There is a C ++ program code that needs to be inserted into a report on work in Word 2013.
But if you directly insert it, you get completely unreadable rubbish.
I want to arrange it the way the code looks in the compiler - with line numbers, correct formatting and syntax highlighting.
I did not find any built-in tools for this. Tell me how can this be done?
Answer the question
In order to leave comments, you need to log in
I did not find any built-in tools for this.
tohtml.com/ - An online code editor with syntax highlighting for a bunch of different languages. Received copy-paste in Word.
From Microsoft Visual Studio, Qt Creator, Eclipse (yes, almost from all IDEs), the code is copied formatted, highlighted, etc.
I probably won’t help you with line numbers, but the highlight is perfectly copied from Qt Creator.
For these purposes, I use Notepad ++ - it has the function of copying RTF to the buffer, the
only thing that there will be no line numbers, it seems
I always insert preformatted text into a table.
The table consists of one large cell if a self-sufficient piece of code or a log fragment is inserted, and several cells if headers or comments are needed.
And as for the syntax highlighting in the copied code, the colleagues above have already said everything.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question