# Figure with long list of predicates and conjunctions (\wedge)

I have a figure with a long list of predicates connected with \wedge, here is the code:

\begin{figure}[h]
\small{
$Defined\_in(subject\_state, concrete\_subject) \wedge Defined\_in (observer\_state, concrete\_observer) \wedge Defined\_in(attach, subject) \wedge Defined\_in(detach, subject) \wedge Defined\_in(notify, subject) \wedge ... it continues ...$
}
\caption{Caption text}
\label{fig:myfig}
\end{figure}


the problem is that the output produced by pdflatex is rather ugly:

\end{lstlisting}

\end{document}


EDIT: If you want automatic line-breaking in dsiplayed math, you could give the breqn package a try; here's a little example using the definitions of egreg's answer:

\documentclass{article}
\usepackage{breqn}

\newcommand{\func}{\textit}
\newcommand{\var}{\textit}

\begin{document}

\begin{figure}
\small
\begin{dmath*}
\func{Defined\_in}(\var{subject\_state}, \var{concrete\_subject}) \wedge\func{Defined\_in}(\var{observer\_state}, \var{concrete\_observer}) \wedge\func{Defined\_in}(\var{attach}, \var{subject}) \wedge\func{Defined\_in}(\var{detach}, \var{subject}) \wedge\func{Defined\_in}(\var{notify}, \var{subject}) \wedge ...
\end{dmath*}
\caption{Caption text}
\label{fig:myfig}
\end{figure}

\end{document}


The result:

-
Tank you for your answer, I am aware of listings package, but this is supposed to be really mathematical formula, although about programming :-) Just for curiosity: it's taken from the Design Patterns Formalization Techniques book. –  Steves May 23 '11 at 10:11
@Steves: I've updated my answer; I included an example that gives automatic line-breaking. –  Gonzalo Medina May 23 '11 at 13:50