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.

My problem is that the items are not so small (hence not bullets) that they exceed left margin. See the example below.

\documentclass[a4paper,12pt]{report}
\begin{document}

\begin{itemize}

\item[ABCD] in the first item, ....

\item[KLMN] in some items like this one, there is so much text that it does not fit in a single line (but this is fine!!!)

\item[WXYZ] ...

\end{itemize}
\end{document}

I tried things like \setlength{\itemindent}{15pt} but it does not look good since I obtain lines (after the item) not aligned. I also tried description instead of itemize, but again I get unaligned text.

Thanks.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

use the KOMA-Script class scrreprt

\documentclass[a4paper,12pt]{scrreprt}
\begin{document} 
\noindent\rule{\linewidth}{1pt}% only demo

\begin{labeling}{WXYZZ}
\item[ABCD] in the first item, ....
\item[KLMN] in some items like this one, there is so much text that it does not fit in a single line (but this is fine!!!)
\item[WXYZ] ...
\end{labeling}

\end{document}

enter image description here

or without another class redefine the environment or define a new one:

\documentclass[a4paper,12pt]{report}
\newenvironment{Description}
               {\list{}{\labelwidth=0pt \leftmargin=4em \itemindent-\leftmargin
                        \let\makelabel\descriptionlabel}}
               {\endlist}    
\begin{document}

\noindent\rule{\linewidth}{1pt}

\begin{Description}
\item[ABCD] in the first item, ....
\item[KLMN] in some items like this one, there is so much text that it does not fit in a single line (but this is fine!!!)
\item[WXYZ] ...
\end{Description}

\end{document}
share|improve this answer
    
Totally agree that that would be a better solution, but the OP explicitly stated a preference to not use enumitem. –  Peter Grill Oct 22 '11 at 21:21
    
I didn't mean that you should remove the enumitem solution. Others that come across this may not have an issue with using enumitem so would still be useful info to have. –  Peter Grill Oct 22 '11 at 21:27
    
Thanks Herbert. I'm not familiar with scrreprt, so I have to see if changing to it makes sense. –  Florian Pei Oct 22 '11 at 21:31
    
@Florian: see edit, you can redefine description –  Herbert Oct 22 '11 at 21:34
    
@Herbert: Many thanks. –  Florian Pei Oct 22 '11 at 23:14

Once I added usepackage[showframe]{geometry}, the problem was more obvious. Since you do not want to use the enumitem package (which would be a better option), you can resort to the DESCRIPTION environment provided at Change hanging indent in description list to fix this (or one of the other solutions for the same question).

enter image description here

\documentclass[a4paper,12pt]{report}
\usepackage[showframe]{geometry}

% http://tex.stackexchange.com/questions/7008/change-hanging-indent-in-description-list
\usepackage{calc}
\makeatletter
\newcommand{\DESCRIPTION@original@item}{}
\let\DESCRIPTION@original@item\item
\newcommand*{\DESCRIPTION@envir}{DESCRIPTION}
\newlength{\DESCRIPTION@totalleftmargin}
\newlength{\DESCRIPTION@linewidth}
\newcommand{\DESCRIPTION@makelabel}[1]{\llap{#1}}%
\newcommand{\DESCRIPTION@item}[1][]{%
  \setlength{\@totalleftmargin}%
       {\DESCRIPTION@totalleftmargin+\widthof{\textbf{#1 }}-\leftmargin}%
  \setlength{\linewidth}
       {\DESCRIPTION@linewidth-\widthof{\textbf{#1 }}+\leftmargin}%
  \par\parshape \@ne \@totalleftmargin \linewidth
  \DESCRIPTION@original@item[\textbf{#1}]%
}
\newenvironment{DESCRIPTION}
  {\list{}{\setlength{\labelwidth}{0cm}%
           \let\makelabel\DESCRIPTION@makelabel}%
   \setlength{\DESCRIPTION@totalleftmargin}{\@totalleftmargin}%
   \setlength{\DESCRIPTION@linewidth}{\linewidth}%
   \renewcommand{\item}{\ifx\@currenvir\DESCRIPTION@envir
                           \expandafter\DESCRIPTION@item
                        \else
                           \expandafter\DESCRIPTION@original@item
                        \fi}}
  {\endlist}
\makeatother

\begin{document}


\begin{DESCRIPTION}

\item[ABCD] in the first item, ....

\item[KLMN] in some items like this one, there is so much text that it does not fit in a single line (but this is fine!!!).

\item[WXYZ] ...

\end{DESCRIPTION}
\end{document}
share|improve this answer
    
Thanks Peter. I was actually thinking that there would be a simple answer for my question. In fact, I wanted to use no more packages at all. –  Florian Pei Oct 22 '11 at 21:25
    
There are other solutions at the linked question that you may prefer. This was based on the selected answer. You don't need the geometry package for this solution. –  Peter Grill Oct 22 '11 at 21:29

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.