1

I'm using LyX to write a simple report. I had some paragraph written as a "description list", when I thought that it may look better as a table instead.

I created a table, and when I copied the text inside the table cell, it kept the "Description" layout, and is still shown as such. I want to change that back to a plain layout, but the drop down widget to select the layout is disabled. Similarly, keyboard shortcuts say "command disabled".

Other than editing the .lyx file manually, is there any better way to do this?

2
  • 1
    Can't you change the list to standard layout before copying it to the table? Oh, and welcome to TeX.SX! – Torbjørn T. Jul 30 '13 at 22:22
  • Thanks! Yes, I can do that, of course. As well as I can modify the .lyx file directly, which is what I ended up doing in the end. My question was more like, for the future, is there a "right way" I am supposed to do this, or is there a good reason why I shouldn't? Let's say, in the future, I may actually want a bullet list inside a cell... – Daniele Jul 30 '13 at 23:00
1

You can use the following action:

command-sequence inset-modify tabular set-pwidth 10cm; layout standard; inset-modify tabular set-pwidth

To run it directly, make sure your cursor is in the cell in the table, press alt+x for the mini-buffer, paste it in, and hit return.

If you like this, you can make a shortcut by going to the following:

Tools > Preferences > Editing > Shortcuts

However, I hope that you don't like this. The best thing to do is to report this as a bug. This is a hack and you should not rely on it.

The reason for this behavior is the following: The mechanism that determines whether you can modify the layout is ForcePlain. For more detail, search for that word in

Help > Customization

It is hardcoded for table insets and is determined as follows (as shown in src/insets/InsetTabular.cpp):

bool InsetTableCell::forcePlainLayout(idx_type) const
{
    return !isFixedWidth;
}

Thus, the hack works as follows: it changes to a fixed width, changes the layout to standard, then removes the fixed width.

If you want a list inside a table in the future (asked in a comment to the question), the correct way is to make a fixed width and then change the layout.

Note that to edit the width graphically, place the cursor in the table and go to

Edit > Table Settings

8
  • Thank you so much! Your "hack" works, but as you said it's a hack, so a bug report is the right thing to do. Also, if it happens again, now I know I just need to set the table to fixed width, then back. In fact, while trying to reproduce the problem, and playing with fixed/variable width with a "Enumerate" layout inside the cell, LyX actually crashed... – Daniele Jul 31 '13 at 7:28
  • If you can provide detailed steps by which you can repeat the crash, that bug report would be very important. Note that this should be posted as a separate bug report. – scottkosty Jul 31 '13 at 8:05
  • Filed a bug report. – Daniele Jul 31 '13 at 8:05
  • @Daniele looks good. I will confirm that it's on the latest development version also. Thanks for doing that! – scottkosty Jul 31 '13 at 8:07
  • Thanks to you! Cannot reproduce the crash, maybe lyx saved a crash report somewhere? – Daniele Jul 31 '13 at 8:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.