[Tex/LaTex] LyX: insert minipage with 100% line width

lyxminipage

I defined the following command sequence in my toolbar:

Item "Insert Minipage" "command-sequence box-insert Frameless; inset-modify width \"100line%\""

Unfortunately, this is not working. lyx -dbg action tells me:

   cmd:  action: 172 [command-sequence]  arg: 'box-insert Frameless; inset-modify width "100line%"' x: 0 y: 0
   cmd:  action: 233 [box-insert]  arg: 'Frameless' x: 0 y: 0
   cmd:  action: 226 [inset-modify]  arg: 'width "100line%"' x: 0 y: 0
>> action inset-modify [inset-modify] is disabled at this location  <<< SEE HERE
   verbose dispatch msg (command-sequence box-insert Frameless; inset-modify width "100line%")

What am i doing wrong?

After box-insert Frameless, the cursor is placed inside the minipage inset. If not there, where actually is inset-modify allowed?

Best Answer

inset-modify should be used just in front of the inset. Thus, the command should be:

Item "Insert Minipage" "command-sequence box-insert Frameless; char-backward; inset-modify width \"100line%\""

How did I know that inset-modify should be used in front of the inset rather than inside it (which I agree is more intuitive)? Well, if you use the GUI and create a box (Insert > Box > Frameless), then, no matter where your cursor is, if you right click on the box and go to "Settings..." the cursor is placed just before the box.