Le 21/02/2016 15:15, David Rörich a écrit :
Hello Jürgen,

no, not directly. As a single line break is ignored in Latex, Lyx seems
to remove these single line breaks automatically to make the editor
layout consistent with the output. I think you have two options here:

Actually, it you paste with Shift+Ctrl+V, LyX will keep the lines. But this is not useful because LaTeX will ignore them as David explained.

1) Use double line breaks in the text you paste into the ERT. Lyx will
convert this to single line breaks in the ERT which translates to a
whitespace in the output. (see files attached)
2) Use the listing environment (Insert > Program listing). Everything
you insert there will be interpreted verbatim. This is the way to go if
you would like to insert program code in your document.

If you do not care about syntax coloring, you can also use the Verbatim layout (or LyX-Code if you want to make some font changes in your text).

JMarc

2016-02-21 9:38 GMT+01:00 Jürgen Lange <[email protected]
<mailto:[email protected]>>:

    Hello,

    Code with carriage returns

    a
    a
    a
    a

    inserted in ERT inset in Lyx appears as

    a a a a

    Is it possible to keep the carriage returns?
    (This is important in cases with huge parts of code, example:
    gnuplot scripts)

    Regards
    Jürgen



Reply via email to