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: END-OF-FRAME, once again..

2021-11-17 Thread Daniel

On 2021-11-18 06:04, Scott Kostyshak wrote:

On Tue, Oct 19, 2021 at 10:29:05AM -0400, Scott Kostyshak wrote:

On Thu, Oct 14, 2021 at 03:14:48PM +0200, Daniel wrote:

On 13/10/2021 16:50, Scott Kostyshak wrote:

On Wed, Oct 13, 2021 at 12:13:30PM +0200, Daniel wrote:

Something that I thought while using beamer with LyX was that it seems that
it would be easier if Frames would not "hang together". I mean: right now,
if you press enter at the end or beginning of a frame, you get a new line
that is extending the same frame. Wouldn't it be easier if you get a new
frame this way and instead would just nest stuff in order to get it onto a
specific frame? So, no need for separators either. There may be issues with
this suggestion that I have not thought careful enough about but on the face
of it, it seems like a good idea to me and to solve the issues you
mentioned. What do you think?


I think the workflow you're suggesting makes the not-always-true assumption that the user 
does not use the "frame" layout for the *content* of the frame, and only uses 
nested layouts (e.g., itemize or standard). Did I understand right?


Yes. It is not a conservative approach. It suggest to not use the frame
layout for the content because, if I see it correctly, this can be equally
achieved by using a nested standard layout. So, why not have just one way of
doing things. And it seems to me more consistent in that, say, itemized
lists have to be nested as well within a frame which makes them appear at
another level than the content of the frame when not nested but they are
not. Isn't that a bit strange or misleading?

Instead, everything will have to be nested if it should go on a frame. (Of
course there must be a lyx2lyx mechanism to transfer old beamer documents to
the new "nesting-style".)

The workflow would in the new style would be like this:

1. Select the Frame layout to create a new frame.
2. Press enter which creates a nested Standard paragraph to add content.
3. Press enter twice to un-nest and get a Frame layout which starts a new
frame.

Doesn't this appear more simple and intuitive?


It does. I think it is a reasonable proposal. I'm just not sure
everyone will agree. For example, our own beamer example uses the
frame layout for content.


One use case that would benefit from your suggested interface:

It's currently annoying to change a "Frame" to a "Fragile Frame" or
"Plain Frame". Consider the following pseudo code:

   [frame content...]
   [more frame content...]
   [nested itemize]
   [frame content...]

You can't just select all paragraphs and change to the new
(Fragile/Plain) Frame. With your workflow, I think it would be
sufficient to change the first paragraph.

Scott


Indeed that is a great use case. Thanks for reporting back while you are 
using beamer more extensively.


I guess the current mechanism could be changed such that when changing 
the layout, say from "Frame" to "Fragile Frame", all following 
paragraphs belonging to the same original layout are changed as well. 
That might be an improvement. But there is an ambiguity because it could 
be the case where someone intentionally wanted to change just this 
single paragraph. Then of course, this person could add a separator. But 
things are getting cumbersome.


With the new workflow, this ambiguity is ruled out and the switch 
between the two cases is more intuitive.


Daniel

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


Re: END-OF-FRAME, once again..

2021-11-17 Thread Scott Kostyshak
On Tue, Oct 19, 2021 at 10:29:05AM -0400, Scott Kostyshak wrote:
> On Thu, Oct 14, 2021 at 03:14:48PM +0200, Daniel wrote:
> > On 13/10/2021 16:50, Scott Kostyshak wrote:
> > > On Wed, Oct 13, 2021 at 12:13:30PM +0200, Daniel wrote:
> > > > Something that I thought while using beamer with LyX was that it seems 
> > > > that
> > > > it would be easier if Frames would not "hang together". I mean: right 
> > > > now,
> > > > if you press enter at the end or beginning of a frame, you get a new 
> > > > line
> > > > that is extending the same frame. Wouldn't it be easier if you get a new
> > > > frame this way and instead would just nest stuff in order to get it 
> > > > onto a
> > > > specific frame? So, no need for separators either. There may be issues 
> > > > with
> > > > this suggestion that I have not thought careful enough about but on the 
> > > > face
> > > > of it, it seems like a good idea to me and to solve the issues you
> > > > mentioned. What do you think?
> > > 
> > > I think the workflow you're suggesting makes the not-always-true 
> > > assumption that the user does not use the "frame" layout for the 
> > > *content* of the frame, and only uses nested layouts (e.g., itemize or 
> > > standard). Did I understand right?
> > 
> > Yes. It is not a conservative approach. It suggest to not use the frame
> > layout for the content because, if I see it correctly, this can be equally
> > achieved by using a nested standard layout. So, why not have just one way of
> > doing things. And it seems to me more consistent in that, say, itemized
> > lists have to be nested as well within a frame which makes them appear at
> > another level than the content of the frame when not nested but they are
> > not. Isn't that a bit strange or misleading?
> > 
> > Instead, everything will have to be nested if it should go on a frame. (Of
> > course there must be a lyx2lyx mechanism to transfer old beamer documents to
> > the new "nesting-style".)
> > 
> > The workflow would in the new style would be like this:
> > 
> > 1. Select the Frame layout to create a new frame.
> > 2. Press enter which creates a nested Standard paragraph to add content.
> > 3. Press enter twice to un-nest and get a Frame layout which starts a new
> > frame.
> > 
> > Doesn't this appear more simple and intuitive?
> 
> It does. I think it is a reasonable proposal. I'm just not sure
> everyone will agree. For example, our own beamer example uses the
> frame layout for content.

One use case that would benefit from your suggested interface:

It's currently annoying to change a "Frame" to a "Fragile Frame" or
"Plain Frame". Consider the following pseudo code:

  [frame content...]
  [more frame content...]
  [nested itemize]
  [frame content...]

You can't just select all paragraphs and change to the new
(Fragile/Plain) Frame. With your workflow, I think it would be
sufficient to change the first paragraph.

Scott


signature.asc
Description: PGP signature
-- 
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