2

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.

\begin{figure}
\begin{flushleft}
\textbf{Function}: Function\\
\textbf{Output}: Some function\\
\end{flushleft}
\begin{algorithmic}[1]
    \For{ $u \in V$} 
      \If { $MyFu(u,v) \wedge MyFu(v,u)$ }
        %something
      \Else
        %something else
      \EndIf
      \\
      \If{$v \textless w \vee ( w \textless v \wedge u \textless w \wedge \invneg Func(u,w) )$}
       %something
      \EndIf
    \EndFor
    \end{algorithmic}
    \caption{My algorithm}
    \label{fig:function}
\end{figure}

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

4
  • 1
    \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, 2012 at 11:23
  • I already tried your solution, but i still get the errors.
    – nurabha
    Sep 5, 2012 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, 2012 at 11:32
  • 4
    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, 2012 at 11:42

1 Answer 1

2

\invneg is defined in package wasysym and package MnSymbol:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{wasysym}
\let\wasyinvneg\invneg
\let\iint\relax
\let\iiint\relax
\usepackage{MnSymbol}
\begin{document}
\begin{tabular}{lll}
\textsf{wasysym} & \texttt{\textbackslash invneg} & $\wasyinvneg$\\
\textsf{MnSymbol} & \texttt{\textbackslash invneg} & $\invneg$\\
\textsf{MnSymbol} & \texttt{\textbackslash backneg} & $\backneg$\\
\end{tabular}
\end{document}

invneg/wasysym/MnSymbol

1
  • Thanks for solution. I just replaced \invneg with \neg because I wanted a logical not symbol.
    – nurabha
    Sep 5, 2012 at 13:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .