3

Can someone help me understand this error message and how to fix it? I don't understand why it thinks it needs to insert a $. The error message is given below.

\documentclass{article}
\usepackage{qtree}
\begin{document}

\[ \neg x_1 \wedge \neg x_2 \wedge x_3 \wedge \neg x_4 = 
 \Tree[.\wedge [.\wedge [.\wedge [.\wedge \top [.\neg x_1 ] ] [.\neg x_2 ] ] x_3 ] [.\neg x_4 ] ] \]

\end{document}

Here is the error message.

! Missing $ inserted.
<inserted text> 
                $
l.8 ...wedge [.\wedge [.\wedge \top [.\neg x_1 ] ]
                                                   [.\neg x_2 ] ] x_3 ] [.\n...
5

Probably the nodes of the tree is set in text mode (even if the tree is inside a math environment), so you need $ .. $ throughout.

\documentclass{article}
\usepackage{qtree}
\begin{document}

\[ 
\neg x_1 \wedge \neg x_2 \wedge x_3 \wedge \neg x_4 = 
 \Tree[.$\wedge$ 
        [.$\wedge$ 
          [.$\wedge$
            [.$\wedge \top$ [.$\neg x_1$ ] ]
            [.$\neg x_2$ ]
          ] $x_3$
        ] [.$\neg x_4$ ]
       ]
\]

\end{document}

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.