1

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.

0

2 Answers 2

3

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}
4
  • Totally agree that that would be a better solution, but the OP explicitly stated a preference to not use enumitem. Commented Oct 22, 2011 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. Commented Oct 22, 2011 at 21:27
  • Thanks Herbert. I'm not familiar with scrreprt, so I have to see if changing to it makes sense. Commented Oct 22, 2011 at 21:31
  • @Florian: see edit, you can redefine description
    – user2478
    Commented Oct 22, 2011 at 21:34
0

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}

% https://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}
2
  • 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. Commented Oct 22, 2011 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. Commented Oct 22, 2011 at 21:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .