Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have an algorithm defined under figure container. For some reason I am getting a strange error in the conditional expression of the second If block statement.

\textbf{Function}: Function\\
\textbf{Output}: Some function\\
    \For{ $u \in V$} 
      \If { $MyFu(u,v) \wedge MyFu(v,u)$ }
        %something else
      \If{$v \textless w \vee ( w \textless v \wedge u \textless w \wedge \invneg Func(u,w) )$}
    \caption{My algorithm}

The errors that I get are the following.

LaTeX Warning: Command \textless invalid in math mode on input line 117.
LaTeX Warning: Command \textless invalid in math mode on input line 117.
LaTeX Warning: Command \textless invalid in math mode on input line 117.

! Undefined control sequence.
<argument> ...\wedge u \textless w \wedge \invneg 
                                              Func(u,w) )$
l.117 ...ess w \wedge \invneg Func(u,w) )$}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Can anyone suggest what maybe wrong in the conditional expression of second if statement ? Also, how to remove the warning ? Thanks

share|improve this question
\textless is a symbol for text, use < instead, plus \textless may require textcomp package to work in text. But there is no need to use \textless as a symbol in math –  daleif Sep 5 '12 at 11:23
I already tried your solution, but i still get the errors. –  nurabha Sep 5 '12 at 11:31
\If{$v$ \textless $w \vee ( w$ \textless $v \wedge u$ \textless $w \wedge \invneg Func(u,w) )$}. This modified line also gives same errors! –  nurabha Sep 5 '12 at 11:32
If you look at the error, it says that \invneg is an unknown command. Either you load a package where it is defined or you define it (i.e., \newcommand{\invneg}{...}) –  Guido Sep 5 '12 at 11:42

1 Answer 1

up vote 1 down vote accepted

\invneg is defined in package wasysym and package MnSymbol:

\textsf{wasysym} & \texttt{\textbackslash invneg} & $\wasyinvneg$\\
\textsf{MnSymbol} & \texttt{\textbackslash invneg} & $\invneg$\\
\textsf{MnSymbol} & \texttt{\textbackslash backneg} & $\backneg$\\


share|improve this answer
Thanks for solution. I just replaced \invneg with \neg because I wanted a logical not symbol. –  nurabha Sep 5 '12 at 13:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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