正常:
修改后:
正常代码:
\documentclass{article}
\usepackage[ruled]{algorithm2e}
\begin{document}
\begin{algorithm}
\caption{Hi}
My name is XXX.
\end{algorithm}
\end{document}
修改后代码:
\documentclass{article}
\usepackage[ruled]{algorithm2e}
%------自定义去掉算法序号的命令
\makeatletter
\newcommand{\RemoveAlgoNumber}{\renewcommand{\fnum@algocf}{\AlCapSty{\AlCapFnt\algorithmcfname}}}
\newcommand{\RevertAlgoNumber}{\algocf@resetfnum}
\makeatother
%-------
\begin{document}
\renewcommand{\algorithmcfname}{XXX} %定义算法的名称
\begin{algorithm}
\RemoveAlgoNumber %调用去掉算法序号的命令
\caption{Hi}
My name is XXX.
\end{algorithm}
\end{document}