# Description Environment options in LyX

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

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

• Thanks @Torbjorn for your answer. Something going weird with me today. I'm using beamer and couldn't add Customisable lists (enumitem) module. Then I tried \usepackage{enumitem} which again not working. Any idea!!! – MYaseen208 Mar 4 '14 at 16:18
• @MYaseen208 No, `enumitem` isn't compatible with `beamer`, sorry. I don't have any alternative at the moment. – Torbjørn T. Mar 4 '14 at 16:21
• One possibility is to use `\usedescriptionitemofwidthas{The longest label}`. This is partial solution which adjust the text but doesn't align the `items`. – MYaseen208 Mar 4 '14 at 17:01
• This is also helpful. – MYaseen208 Mar 4 '14 at 17:07
• Thanks @Torbjorn for your help. I figure out the problem. See my answer. – MYaseen208 Mar 5 '14 at 2:41

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.