How to paste into LyX-Code ?!!

Daniel xracoonx at gmx.de
Thu Nov 18 07:48:07 UTC 2021


On 2021-11-17 23:28, Steve Litt wrote:
> Daniel said on Wed, 17 Nov 2021 10:44:23 +0100
> 
>> On 17/11/2021 10:01, Steve Litt wrote:
>>> Hi all,
>>>
>>> I have a C program I want to show in a book. So I use the LyX-Code
>>> environment, but when I copy the C file to the clipboard and paste it
>>> into the LyX-Code environment, all the newlines are removed. What's
>>> the right way to show a C program file within LyX?
>>>
>>> Thanks,
>>>
>>> SteveT
>>>
>>> Steve Litt
>>> Spring 2021 featured book: Troubleshooting Techniques of the
>>> Successful Technologist http://www.troubleshooters.com/techniques
>>>    
>>
>> You could try
>>
>> "Edit" > "Paste Special" > "Plain Text" or Ctrl+Shift+V.
> 
> The preceding worked. Thank you!
>>
>> I never understood what "Plain Text" does not among other things it
>> should keep the line breaks. I guess keeping line-breaks should be the
>> default...
> 
> It's ridiculous that it's not the default, you're right.
> 
> Thanks also to Norman Dunbar who suggested the same things.
> 
> Thanks also to Hartmut Hasse and Stephan Witt for their suggestions,
> which I didn't try for lack of time once the Shift+Ctrl+v worked.
> 
> I spent 2 hours trying to find a method last night, before figuring I'd
> be better off asking the list. Thanks for your suggestions!
> 
> SteveT

Sorry to hear that you wasted so much time. Others seem to have been 
there before as well:

https://www.lyx.org/trac/ticket/8026

Unfortunately, gmane is dead and I couldn't figure out where the 
mentioned discussion is. But I guess its result just wasn't followed by 
action. I tried to bump the ticket up again.

And there was someone on the list, I think, who had a similar problem 
when pasting into ERT where joining lines seems to be no good idea either.

In general, it seems to me that the default paste should honor the 
format of the original. And if that isn't desired, "join lines" could be 
selected.

(Mostly there is *some* good idea for why things are as they are but 
there needs to be adjustment in light of people's actual experiences.)

Daniel



More information about the lyx-users mailing list