How to not convert layout when pasting?

Scott Kostyshak skostysh at
Fri Apr 9 14:58:57 UTC 2021

On Fri, Apr 09, 2021 at 10:13:27AM +1200, Andrew Parsloe wrote:
> On 9/04/2021 5:12 am, Enrico Forestieri wrote:
> > On Thu, Apr 08, 2021 at 12:01:29PM -0400, Scott Kostyshak wrote:
> > > Sometimes I want to copy something from an itemize environment and
> > > paste it into a new enumerate item. If I start a new enumerate item
> > > and just paste, LyX converts the layout to itemize. My workaround is
> > > to type "a" and then paste. This way, the enumerate is preserved. Then
> > > I delete the "a". I forget why I developed this habit rather than just
> > > pasting, let LyX convert to itemize, then simply convert back to
> > > enumerate. Perhaps the nesting was not fixed when I do this instead?
> > > In any case, that's not ideal either.
> > > 
> > > Do others often run into a similar situation?
> > Yes, all the time. This is really annoying. However, if you want to
> > paste only text (no insets), put the following line in you user.bind file:
> > 
> > \bind "C-M-v" "clipboard-paste-simple"
> > 
> > and then use Ctrl+Alt+V for pasting.
> Thank you Enrico. This solves for me a matter that has often irritated.
> Strangely, the very first time I tried Ctrl+Alt+V, copying from itemize to
> enumerate, the bullet from the itemize environment was also copied so that
> the result looked like "1. * itemize" (where the asterisk denotes the
> itemize bullet). I've been unable to reproduce since (in 2.4.0-alpha3).

Thanks, Enrico. I think most of the time it does have insets. But this
idea does make me think about crafting a command-sequence that might
work. The following seems to do what I want:

  command-sequence bookmark-save 0; self-insert A; paste; bookmark-save 9; bookmark-goto 0; char-delete-backward; bookmark-goto 9

The bookmark commands are because I did not find a "paragraph-begin"
LFUN (I see only line-begin) and "paragraph-end". I started a new thread
for this.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <>

More information about the lyx-devel mailing list