# dialogue environment beginning with \direct fails

I am using the dialogue environment, and I want to start a dialogue with a setting, using the \direct command. However, the following code does not compile:

\documentclass{article}

\usepackage{dialogue}

\begin{document}

\begin{dialogue}
\direct{This is a setting.}

\speak{John Doe} I am speaking.
\end{dialogue}

\end{document}


I get the following error message:

! LaTeX Error: Something's wrong--perhaps a missing \item.

....

l.10 \speak{John Doe}
I am speaking.


This doesn't happen when I start with \speak. What should I do to get around this apparent bug in the package?

-
While code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem. –  Peter Grill Jan 21 '13 at 2:01
My bad, I didn't realize that the MWE needed to also include the \documentclass and included packages, etc. I have updated my answer accordingly –  cg505 Feb 26 '13 at 2:18
I'm just wondering whether there exist other packages doing this thing, since this one seems rather badly written... –  mbork Feb 26 '13 at 3:16

Well, it seems to be a bug in dialogue. I'd suggest this quick-and-dirty fix (which I hope doesn't break anything...):

\usepackage{etoolbox}
\makeatletter
\appto{\PreDialogue}{\global\@newlistfalse}
\makeatother


Also, I guess \direct should start with a \par or maybe even \par\medskip or something. I'd definitely consider hacking this package a bit.

-
If you want inline stage directions, however, I don't think a \par at the beginning of every \direct would work. –  cg505 Feb 27 '13 at 22:41
+1. Seems it's been a long time since I actually read some play;)... –  mbork Feb 27 '13 at 22:43

It seems that the dialogue environment can't start with a \direct{} command due to the list structure which creates an orphan \item. Taking it out from the dialogue environment solves the error. Putting a \speak before works too. Also in the manual (14 years old!) it's stated that \direct{} command has a different meaning which might be this detail.

\documentclass{article}

\usepackage{dialogue}

\begin{document}

\direct{This is a setting.}
\begin{dialogue}
\speak{Play-Doh} I said speak!
\speak{John Doe} I am speaking.
\end{dialogue}

\end{document}


-
This will work for the given scenario, but it is unfortunate that it gives a different level of indentation than the other \directs. –  cg505 Feb 27 '13 at 2:57