2

As title suggests, I am having problem with creating a dirtree. Currently the problematic part is:

\section{Use Cases}
\par Some entry explaining why I will be writing this dirtree. 
\begin{figure}%
\dirtree{%
    .1 Customer tests
    .1 Connection tests
    .2 Database Connection tests
    .2 MailServer Connection tests
    .2 Internet Connection tests
    .2 CMS Connection tests
    .3 Initialize Connection
    .3 Close Connection
    .3 Force Disconnect
    .3 Simulate Internet Failure
    .1 Service tests
}
\end{figure}
\par Some more sentences that will use the dirtree above

But when I try to build the file, error "Paragraph ended before \next was complete" appears, pointing to the ending bracket of the dirtree.

I am not very experienced in LaTeX so I would welcome all suggestions. Thank you very much.

erewien
  • 123

1 Answers1

2

The syntax requires an additional period at the end of each entry:

\documentclass{article}
\usepackage{dirtree}
\begin{document}
\section{Use Cases}
Some entry explaining why I will be writing this dirtree.

\dirtree{%
    .1 Customer tests.
    .1 Connection tests.
    .2 Database Connection tests.
    .2 MailServer Connection tests.
    .2 Internet Connection tests.
    .2 CMS Connection tests.
    .3 Initialize Connection.
    .3 Close Connection.
    .3 Force Disconnect.
    .3 Simulate Internet Failure.
    .1 Service tests.
}

Some more sentences that will use the dirtree above
\end{document}

Result

It is still wrong. The first rule that the root must have level 1 is not violated, but the following nodes must have a level between 2 and n + 1 with n as level of the previous node.

The following example

  • fixes the second rule,
  • adds a new root,
  • adds an horizontal indentation and vertical space around the tree by environment quote with minipage.
\documentclass{article}
\usepackage{dirtree}
\begin{document}
\section{Use Cases}
Some entry explaining why I will be writing this dirtree.
\begin{quote}
\begin{minipage}{\linewidth}
\dirtree{%
    .1 /.
    .2 Customer tests.
    .2 Connection tests.
    .3 Database Connection tests.
    .3 MailServer Connection tests.
    .3 Internet Connection tests.
    .3 CMS Connection tests.
    .4 Initialize Connection.
    .4 Close Connection.
    .4 Force Disconnect.
    .4 Simulate Internet Failure.
    .2 Service tests.
}
\end{minipage}
\end{quote}
Some more sentences that will use the dirtree above
\end{document}

Result

Heiko Oberdiek
  • 271,626