Re: How to paste into LyX-Code ?!!

2021-11-18 Thread Steve Litt
Daniel said on Thu, 18 Nov 2021 08:48:07 +0100

>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. 

Thanks Daniel. I'm not sorry: It's adventures like this that keep me on
my toes. Also, I don't ask on the list until I've done significant
research.

> Others seem to have been 
>there before as well:
>
>https://www.lyx.org/trac/ticket/8026

Until somebody gets around to "fixing" it, which at this point would
mess up those used to the current behavior, it could be treated as a
documentation problem.

It would be interesting to put it on a page titled "The Top 20
Unexpected Behaviors in LyX". That page could be prominently linked to
by many other pages.

I'm so used to LyX that I long ago forgot the other 19 :-).

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?!!

2021-11-17 Thread Daniel

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

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?!!

2021-11-17 Thread Steve Litt
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

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?

2021-11-17 Thread Norman Dunbar
Ctrl-shift-v pastes with new lines. 
Ctrl-v pastes without.

Caught me out for a while.

Cheers,
Norm.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

On 17 November 2021 09:01:12 GMT, 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
>-- 
>lyx-users mailing list
>lyx-users@lists.lyx.org
>http://lists.lyx.org/mailman/listinfo/lyx-users
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?

2021-11-17 Thread Stephan Witt
Am 17.11.2021 um 10:01 schrieb Steve Litt :
> 
> 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?

Hi Steve,

you may insert a Listings inset and configure it to point to your C file.

After that you can define the lines you want to show and many more things.

See here for the options:
https://mirror.dogado.de/tex-archive/macros/latex/contrib/listings/listings.pdf

BR, Stephan
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?

2021-11-17 Thread Daniel

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.

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...


Daniel

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: How to paste into LyX-Code ?

2021-11-17 Thread Hartmut Haase
Hi Steve, 
what if you rename  the .c file into .txt and do in Lux insert➡️file ➡️ simple 
text?
-- 
Viele Grüße
Hartmut 
Diese Nachricht wurde mit meinem Tablett serviert.-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


How to paste into LyX-Code ?

2021-11-17 Thread Steve Litt
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
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users