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

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}
  • This, (together with adjustwidth for more descriptions inside descriptions) is the solution! – ipo Aug 31 '17 at 10:12
2

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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