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.
Asked
Active
Viewed 194 times
2
-
1I suppose the idea is to write the complete program (including documentation) directly in LyX, not copy/paste it in there. (I'm not a LyX user, so I can't really comment on how to do this.) – Paŭlo Ebermann Sep 22 '11 at 12:44
-
I’m not really sure what the question here is – this somewhat relates to Paŭlo’s comment: either just write the whole program in LyX or, if you don’t want that, write the *literal program code* in gedit and open it in LyX (LyX *can* open plain LaTeX files, right?). – Konrad Rudolph Sep 23 '11 at 09:15
-
But you loose the indentation. It is very difficult to separately enter tabs again – Vishwanath Sep 23 '11 at 10:07
-
@Vishwanath What do you mean, you lose the indentation? This shouldn’t happen. That said, using tabs for indentation causes more trouble than it’s worth. – Konrad Rudolph Sep 23 '11 at 11:01
2 Answers
2
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.

Praveen
- 6,872
- 3
- 43
- 62
2
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/

Vishwanath
- 835
- 1
- 7
- 19