我正在尝试使用 algorithm2e 包在背面在线编辑器中编写算法。我不断收到错误,不确定导致此错误的原因是什么,这是我的代码:
\documentclass{article}
\usepackage{xcolor}
\usepackage[linesnumbered,ruled,vlined]{algorithm2e}
\title{Algorithm template updated}
\author{Roy}
\newcommand\mycommfont[1]{\footnotesize\ttfamily\textcolor{blue}{#1}} \SetCommentSty{mycommfont}
\SetKwInput{KwInput}{Input} % Set the Input
\SetKwInput{KwOutput}{Output} % set the Output
\begin{document}
\maketitle
\begin{algorithm}[H]
\DontPrintSemicolon
\KwInput{C}
\KwOutput{groups in C}
initialization $D_b^C \leftarrow 0$\;
\For{$Each node v \in c $}
{
$Nd_c (v)$ neighbors of v within distance \delta$(i)$\;
\For{$Each node w$ \in $Nd_c (v) $}
{
\if{$dist(v, w)$ \leq \delta$(i)$}
{
$d ̅$ \leftarrow$ (d_v+ d_w)\div$\;
\if{ $d ̅ \geq Nd_$c }
{
$Nd_c \leftarrow d ̅$\;
}
}
}
\if{$d_v$ \leq $Nd_c$}
{
label v as detected\;
}
}
\caption{**Groups in Data**}
\end{algorithm}
\end{document}