LyX文字编程
我一直在 gedit 中编写代码,但在本周末我们需要提交 lyx 文字编程文件。复制粘贴或导入是痛苦的,因为我们需要不断按制表符或输入键。谁能建议一个简单的替代方案?请记住,我们需要从 lyx 文件导出 c 文件。
I keep writing codes in gedit but at the end of the week we need to submit a lyx literal programming file. Copying and pasting or importing is painful, since , we need to keep pressing tabs or enters. Can anyone suggest a simple alternative to this? Please keep in mind that we need to export the c file from the lyx file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我朋友的帮助下,我编写了一个 python 代码来转换 python 或 c 或任何其他代码,就像转换为 lyx 文件一样。您可以稍后将任何您想要的内容添加到 lyx 文件中,
这是链接:http://dpaste.com/hold/ 671718/
With the help of my friend, i have written a python code to convert the python or c or any other code, as it is to a lyx file. you can later add whatever you want to the lyx file
Here is the link: http://dpaste.com/hold/671718/
上述链接已损坏,但这里是原始链接。
该脚本本质上是获取代码并从中创建 LyX 片段。它要求在相关机器上安装 scrap 和 noweb。另外,我相信我是为 LyX v.1.6 制作的。不确定它将如何对抗新版本。话又说回来,在新版本中,人们可以在废代码中使用制表符进行选择和缩进,因此OP的问题得到了一定程度的缓解。
The aforementioned link is broken, but here's the original.
The script essentially takes code and creates LyX scrap from it. It requires that scrap and noweb be installed on the machine in question. Also, I believe I'd made this for LyX v.1.6. Not sure how it will hold up against newer versions. Then again, one can select and indent using tab in scrap code in the newer versions, so the OP's problem is somewhat mitigated.