GeneralHelp with enumerate and description

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Malkav
Posts: 3
Joined: Mon May 05, 2008 6:17 pm

Help with enumerate and description

Post by Malkav »

Hi there! First of all: sorry for my bad english, i'm not a native speaker.
I have some problem creating the Layout I want: in most of my books examples are written like this:

TextTextTextTextTextTextTextTextTextTextTextText

_____(a)____Example ExampleExampleExample

TextTextTextTextTextTextTextTextText

how do I recreate this layout?
one possible solution is by using the enumerate command and add to each item the letters a,b,c etc. in brackets. is there another way to do this?
To explain my problem a bit better: i want to enumerate each example in my document just like mathematical formulas are in the equasion environnement, but with the brackets to the left.

Thanks for your help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Help with enumerate and description

Post by gmedina »

To customise the list-like environments (enumerate, description, itemize) use the enumitem package. Refer to its documentation to see all the options it offers. A little example:

Code: Select all

\documentclass{article}
\usepackage{enumitem}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text 
\begin{enumerate}[label=(\alph*)]
  \item First item
  \item Second item 
\end{enumerate}
text text text text text text text text text text text 
\end{document} 
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Malkav
Posts: 3
Joined: Mon May 05, 2008 6:17 pm

Re: Help with enumerate and description

Post by Malkav »

Thanks for your answer!
I forgot to write that I already tried your solution but for som unknown reason it doesn't work: every time I want to use options for the enumerate command, latex stops compiling.
i'm using the following packages
\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
on the newest version of Texlive
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Help with enumerate and description

Post by gmedina »

The following example compiles with no problems on my system (TeX-Live 2007, Kile 2.0):

Code: Select all

\documentclass{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{enumitem}

\begin{document}

text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text
\begin{enumerate}[label=(\alph*)]
  \item First item
  \item Second item
\end{enumerate}
text text text text text text text text text text text

\end{document}
If it does not compile on yours, then please attach the .log file that you get after processing it.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Malkav
Posts: 3
Joined: Mon May 05, 2008 6:17 pm

Re: Help with enumerate and description

Post by Malkav »

? Now it seems to work, even with older documents...
strange ???

Thanks a lot!
almos
Posts: 1
Joined: Tue Jun 10, 2008 1:01 pm

Help with enumerate and description

Post by almos »

Hi,

I've a problem, and I couldn't find any solution yet. I try to create a definition list, but the hyphenotaion doesn't work within the item (I mean here: \item[hyphenation doesn't work here]). What could be the problem? On my previous laptop it was OK, but now it doesn't work either on Ubuntu nor on Vista :(

Here is my preambulum :

\documentclass[a4paper,10pt]{article}

\usepackage[utf8]{inputenc}
\usepackage[hungarian]{babel}
\usepackage{fontenc}
\usepackage{graphicx}

\date{2008-06-10}
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Help with enumerate and description

Post by gmedina »

I am not sure if I undestood your question correctly. The following code could be useful:

Code: Select all

\documentclass[a4paper,10pt]{article}

\begin{document}

%this will cause an overfull \hbox
\begin{description}
  \item[A somehow unusual very very very very very very very very very very very very long descriptor] First item 
  \item[A regular descriptor] Second item
\end{description}

%this will prevent the overfull \hbox
\begin{description}
  \item[\parbox{.9\linewidth}{A somehow unusual very very very very very very very very very very very very long descriptor}] First item 
  \item[A regular descriptor] Second item
\end{description}

\end{document}
If your problem had a different nature, please describe it more explicitly.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply