On 10.08.2008, at 18:24, Paul A. Rubin wrote:

Steve Burton wrote:

I tried using ERT. If I got it wrong Lyx crashed.

If that's reproducible, it should probably be entered into bugzilla.

If I got it right it
worked until I closed Lyx. When the document was re-opened Lyx spotted
the  listings stuff but didn't understand the language. Return to Go,
go directly to Go, do not collect £200!

When you reopened the doc, did LyX convert your ERT listings stuff to a listings inset?? If so, that can probably be worked around. You could load the listings package in the preamble and add a new environment (say "mylistings") that simply begins/ends a listings environment with your new language selected. Then use \begin{mylistings}...\end{mylistings} in ERT. I doubt LyX would make any attempt to convert that.

I do not think that this is the problem. I used to use listings in ERT all the time and LyX never converted it "automagically". I only recently switched to the listings inset, so in many of my documents ERT-based listings and listing insets now happily co-exist. I also use an own language.

A better workaround:

Load (or define) your language in the preamble. In the listings inset select "No language", go to the "Advanced" page and directly pass the language= parameter to listings.

Daniel

Reply via email to