2

The code given here can be used to adjust the items and text in description environment. I wonder how to use these options [leftmargin=!,labelwidth=\widthof{\bfseries The longest label}] with beamer in LyX. Thanks

MYaseen208
  • 8,587

2 Answers2

2

A workaround is to not use a list at all, but a table where the first column is an l column, and the second is a p column. Add a table with Insert --> Table, or the corresponding button on the toolbar, remove all horizontal and vertical lines, and make it two columns. Right click a cell in the second column, and choose More --> Settings. Set the width to a specific value, this will allow for line breaking in the second column. Make the first column left aligned.


Original answer -- doesn't work for beamer

  1. Add the Customisable lists (enumitem) module, in Document --> Settings --> Modules.

  2. To use \widthof you need to load the calc package, so in Document --> Settings --> LaTeX preamble add

    \usepackage{calc}
    
  3. Right click the first entry in the list, choose Insert short title.

  4. Add an ERT in the opt box, with Ctrl + L.

  5. Write leftmargin=!,labelwidth=\widthof{\bfseries The longest label} in the ERT.

You can also define global settings for all description lists, as I mention in my answer to Description-like environment with fixed labels width

Torbjørn T.
  • 206,688
2

Got it!!!

  1. Add \defbeamertemplate{description item}{align left}{\insertdescriptionitem\hfill} in preamble.

  2. Use description environment in LyX.

  3. Add \setbeamertemplate{description item}[align left] in ERT before the description environment in LyX.

  4. Right click the first entry in the list, choose Insert Longest label.

  5. Add an ERT in the opt box, with Ctrl + L.

  6. Write The longest label in the ERT.

MYaseen208
  • 8,587