I use the following template for KDD 2017 – for conference (sample-sigconf file): here.
This is the code I use for the my algorithm:
\documentclass[sigconf]{acmart}
\usepackage{booktabs,makecell,tabularx}
\renewcommand\theadfont{\small}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\usepackage{siunitx}
\usepackage{adjustbox}
\usepackage{array,booktabs}
\usepackage{graphicx}
\usepackage{epstopdf}
%\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage{algorithm}% http://ctan.org/pkg/algorithms
\usepackage{algpseudocode}% http://ctan.org/pkg/algorithmicx
\usepackage{amsmath}
\begin{algorithm} [H]
\caption{Dsfdgfgskj sdfgfkjsdl sdfggjlkj fgsdt}
\label{alg:ALG1}
\textbf{INPUT:} $x$ - decision tree\\
\textbf{OUTPUT:} $abc$ is $x$ in Txx Bxxxxx Gxxxx
\begin{algorithmic}
\State Function $UpdateNodes(x)$:
\If { $wrejkwe$ ($rw$) trwer tewwerl }
% \COMMENT {
\State {jklrjkljfgkljlkj kjkldfj gfdsdf }
\State Set fdgsdsd
\ForAll {$j=1$ to $N (x)$}
\State Call fgsd(x)$
\State Set sfgdfgd =sfdg + fgds
\EndFor
\EndIf
\end{algorithmic}
\end{algorithm}
However, the input and output are aligned to center. How can I change it to be aligned to left?
Best Answer
Use the commands of package
algpseudocode
to define input, output, and function heading. The predefined commands\Require
and\Ensure
are intended for describing the in- and output. If you don't like the keywordsRequire
andEnsure
, redefine them:You can also define new statements
\Input
and\Output
:Now you can use
\Input ...description of input
and likewise\Output ...
.For the function heading, use