我在图形容器下定义了一个算法。出于某种原因,我在第二个 If 块语句的条件表达式中遇到了一个奇怪的错误。
\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}
我收到的错误如下。
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.
有人能指出第二个 if 语句的条件表达式中可能存在什么问题吗?另外,如何消除警告?谢谢
答案1
\invneg
wasysym
在包和包中定义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}