我正在尝试使用以下代码将标题放在代码上方COLT'17 会议乳胶款式。有一个类似的问题这里,但他们的解决方案与 COLT latex 样式结合时似乎不起作用:
\documentclass[anon,12pt]{colt2017} % includes algorithm2e, I believe in jmlr.cls
\makeatletter
\renewcommand{\@algocf@capt@plain}{above}% formerly {bottom}
\makeatother
\begin{document}
\begin{algorithm}[H]
\SetAlgoLined
\KwData{this text}
\KwResult{how to write algorithm with \LaTeX2e }
initialization\;
\While{not at end of this document}{
read current\;
\eIf{understand}{
go to next section\;
current section becomes this one\;
}{
go back to the beginning of current section\;
}
}
\caption{How to write algorithms}
\end{algorithm}
\end{document}
另外,我想添加水平线作为分隔符(通常由 \usepackage[ruled]{algorithm2e} 启用)。如能得到任何帮助,我将不胜感激!