Preserving line breaks and paragraph ends when pasting to LyX

line-breakinglyx

When pasting (Ctrl+V) text in LyX all line endings are removed.
When pasting as special text (Ctrl+Shift+V) all line endings are replace by paragraph ends. I have text that has both paragraphs and line breaks.

How can it be pasted into Lyx preserving the line breaks (as distinct from paragraph ends)?

When pasting from the web to LibreOffice Writer it is preserved correctly so I am quite certain that the information is there.

If not possible how can the result be otherwise achieved?

Search and replace in LyX does not seem to be able to search line endings and doing it directly in the LyX file seems like the very last resort, given how chatty the format is…

Best Answer

LyX aims to maintain the interpretation of TeX in its representation. So, input text representing

Line 1
Line 2

will be considered as part of the same paragraph and therefore pasted that way:

Line 1 Line 2

or within the editor as:

enter image description here

If you want to force these to have a rigid line-break the way you have it in the input text, add the line-break \\ verbatim

Line 1 \\
Line 2

and Edit > Paste Special > Paste from LaTeX:

enter image description here