Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am seeming to have troubles with two environments dealing with lists. The two are

\begin{description}           \begin{problemlist}
  .....                         ......
\end{description}              \end{problemlist}

The trouble is that the text with the body of the document will not align properly, as it will with other list environments such as

\begin{enumerate}           \begin{itemize}
  .....                         ......
\end{enumerate}              \end{itemize}

A mwe is provided below:

\documentclass[12pt]{article}
\usepackage{enumerate}

\oddsidemargin=0pt
\topmargin=1pt
\evensidemargin=0pt
\headheight=15pt
\headsep=15pt
\textwidth=6.2truein
\marginparsep=0pt
\textheight=8.75truein

\pagestyle{empty}

\begin{document}

\begin{description}
\item[Problem 1.] The sky is a very nice blue color. The sky is a very nice
blue color. The sky is a very nice blue color. The sky is a very nice blue color. The 
sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color.

\bigskip

\hspace{1.4cm} \textbf{\underline{Solution:}}

\vspace{0.15in}

\hspace{1.42cm} 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color.
\end{description}

\end{document}

You will see that the sentences after the very first sentence in each paragraph does not stay aligned with the with the first one. When changing the environment to enumerate or itemize you will see the automatic alignment.

Is there a fix for this of some kind?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

You can use the package enumitem It is more comfortable as enumerate and has more features.

You should also use the package geometry instead of the manual manipulation of the lengths.

EDIT 1: Use geometry

EDIT 2: I expand the example with newlist and setlist. Now you can use the environment problemdescript.

**EDIT 3: See comments -- I Changed the format of the label to "Problem 1".

\documentclass[12pt]{article}
\usepackage{enumitem}
\usepackage{geometry}
\geometry{textwidth=6.2truein,textheight=8.75truein}
\geometry{showframe}
\pagestyle{empty}

\newlist{problemdescript}{enumerate}{1}
%\setlist[problemdescript]{font=\sffamily\bfseries,label={Problem~\arabic*.},leftmargin=2.5cm}
\setlist[problemdescript]{label={\textbf{Problem}~\arabic*.},leftmargin=2.5cm}
\begin{document}
\begin{problemdescript}
\item The sky is a very nice blue color. The sky is a very nice
blue color. The sky is a very nice blue color. The sky is a very nice blue color. The 
sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color.

\bigskip

\hspace{1.4cm} \textbf{\underline{Solution:}}

\vspace{0.15in}

\hspace{1.42cm} 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color.
\end{problemdescript}


\begin{description}[font=\sffamily\bfseries,leftmargin=2.5cm,style=sameline]
\item[Problem 1.] The sky is a very nice blue color. The sky is a very nice
blue color. The sky is a very nice blue color. The sky is a very nice blue color. The 
sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color.

\bigskip

\hspace{1.4cm} \textbf{\underline{Solution:}}

\vspace{0.15in}

\hspace{1.42cm} 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very  
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color. 
The sky is a very nice blue color. The sky is a very nice blue color. The sky is a very 
nice blue color. The sky is a very nice blue color. The sky is a very nice blue color.
\end{description}

\end{document}
share|improve this answer
    
@nightowl let us continue this discussion in chat –  Marco Daniel Aug 14 '11 at 13:18
add comment

I recommend using the enumitem package instead of the enumerate package. It offers many ways for customizing margins and alignment. With enumitem you can create your own self-designed lists. Check out the documentation.

share|improve this answer
    
Thanks for that info. How could one actually do it using the above environments, or is it too hard? :) –  night owl Aug 14 '11 at 11:36
    
@night owl:You can customize above environments simply by options such as Marco showed \begin{description}[leftmargin=2.5cm,style=sameline] ... or by \setdescription or \setlist. The only hard issue is reading the manual, to which I put a link. –  Stefan Kottwitz Aug 14 '11 at 12:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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