0

I want to use the description environment, but without indenting.

\begin{description}
\item[Test1]\hfill \\
This is test 1
\item[Test2]\hfill \\
This is test 2
\item[Test3]\hfill \\
This is test 3
\end{description}

This code generates this:

enter image description here

It should look like this:

enter image description here

i know, i could use \textbf{} for the headlines, but is there also a way with description?

2 Answers2

3

Below code may helps you:

\makeatletter
\renewenvironment{description}
               {\list{}{\labelwidth\z@ \itemindent\z@\leftmargin\z@
                        \let\makelabel\descriptionlabel}}
               {\endlist}
\renewcommand\descriptionlabel[1]{\hspace\labelsep
                                \normalfont\bfseries #1}
\makeatother

\begin{description}
\item[Test1]\hfill \\
This is test 1
\item[Test2]\hfill \\
This is test 2
\item[Test3]\hfill \\
This is test 3
\end{description}
MadyYuvi
  • 13,693
3

Why reinvent the wheel? With enumitem you have all the tools needed via a system of keys:

\documentclass{book}
\usepackage{enumitem}
\setlength\parindent{1em}

\begin{document}

\begin{description}[style=nextline, leftmargin=0pt, parsep=0pt, listparindent=1em, itemsep=1ex, font =\sffamily\bfseries]
  \item[Test1]
        This is test 1.

  \item[Test2]
        This is test 2.

  \item[Test3]
        This is test 3.

        A second (indented) paragraph in the description of this item.
\end{description}

\end{document} 

enter image description here

Bernard
  • 271,350