tags:

views:

523

answers:

1

What is the best way of inserting python/C++ code in a Lyx document? The code is small examples less than 20 lines.

My Lyx document is using the Book document class.

Orjanp

+3  A: 

There should be an Insert -> Program Listing option. That uses listings Latex package, so you should have that installed. The support seems to have been added in Lyx 1.5, and from their screenshot, it seems it gives you a lot of customization options.

Alok
Thanks. I'll have a look at it.
Orjanp
What I did was this.First I inserted a <box>, then a <program listing>, and in the end a <caption>. By having a box around it I can have a visible frame around the code.
Orjanp