问题描述
我一直在尝试将我的源代码从eclipse / ADT复制粘贴到MS Word,并保留格式。但是我无法在每行代码旁边复制行号,即使我在窗口 - >下查看
,它仍然不会粘贴。显示行号
偏好 - >一般 - >编辑 - >文本编辑器
I've been trying to copy-paste my source code for a few java classes from eclipse/ADT to MS Word, and the formatting is retained. But I'm unable to copy the line numbers next to each line of code, and even if I check Show Line Numbers
under Window -> Preferences -> General -> Editors -> Text Editors
, it still doesn't paste.
我缺少什么? (我搜索了一段时间,但没有找到任何东西...如果有什么东西解决这个,我没有看到它,抱歉)
What am I missing? (I searched around for some time but haven't found anything... if there's anything on SO that addresses this, I haven't seen it, sorry)
推荐答案
根据您的eclipse版本,如果您激活了显示行号选项,行号将被添加。
Depending on your eclipse version, lines numbers will be added or not, if you activated the 'Show line numbers' option.
如果它不适用于您的eclipse版本,有一个简单的解决方案:
If it doesn't work with your eclipse version, there is a simple solution :
- 展开您的文件中的所有代码(Ctrl + Numpad_Multiply) ,
- 选择所有内容(Ctrl + A),
- copy&粘贴到您的新Word文档
- 在页面布局中,将行号设置为连续。
- expand all your code in your file (Ctrl+Numpad_Multiply),
- select everything (Ctrl+A),
- copy & paste in your new Word document,
- in 'Page Layout', set 'Line Numbers' to 'Continuous'.
这篇关于从Eclipse复制/粘贴到具有行号的Word?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!