Syntax highlighting in MS Word document(MS Word 文档中的语法高亮)
问题描述
我想在 Microsoft Word 文档中插入一些 C/C++ 源代码.我从源文件中复制代码并粘贴到 Word 中没有问题.我可以做固定宽度.但是,在 Word 中,我看到的是黑白格式的代码;当我进入源代码编辑器(对我来说,gvim)时,我松开了语法突出显示.所以,我的问题是,有没有办法在 MS Word 中对 C/C++ 源代码进行语法高亮显示?
I want to insert some C/C++ source code into a Microsoft Word document. I have no problem in copying the code from source file and pasting into Word. I can do fixed-width. But, in Word, I see the code in black-and-white format; I loose the syntax highlighting as I get in the source code editor (for me, gvim). So, my question is, is there any way to do syntax highlighting of C/C++ source code in MS Word?
推荐答案
我找到了 Notepad++也可以将代码复制为 .rtf 文件.插件/NppExport/将 RTF 复制到剪贴板,然后您可以将它们粘贴到带有突出显示和布局的 word 中.
I found Notepad++ also can copy the code as .rtf file. Plugin/NppExport/Copy RTF to Clipboard, Then you can paste them into word with highlight and layout.
这篇关于MS Word 文档中的语法高亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MS Word 文档中的语法高亮
基础教程推荐
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- 初始化列表*参数*评估顺序 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- CString 到 char* 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
