I am using algorithm2e
package to write an algorithm. I need to define functions where their descriptions are multi-lines. In the first function only, algorithm2e
adds extra space in the second, third, ..etc. line. But from the second function and afterwards, it does not add this extra space which looks as I want. I need to remove the extra space added in the first function lines (all lines after the first line). The script is here. I use ACM conference template and I need the algorithm in 2 columns as it is long (not like this small sample).
Here is the script:
\documentclass[sigconf]{acmart}
\pagestyle{empty}
\usepackage{amsmath}
\usepackage[ruled,vlined]{algorithm2e}
\usepackage{multicol}
\begin{document}
\title{Title Here}
\begin{abstract}
Abstract here.
\end{abstract}
\maketitle
\section{Algorithm}
\begin{algorithm*}
\begin{multicols}{2}
\SetKwInOut{Input}{input}\SetKwInOut{Output}{output}\SetKwInOut{Functions}{Functions}
\SetKwFunction{Query}{Query}\SetKwFunction{Calc}{Calc}
\Functions
{
\Query{$a,b$}: Queries a and b and returns the answer as c. This function name is Query.\;
\Calc{$a,b$}: Calculates a and b and returns the answer as c. This function name is Calc.\;
}
\caption{The algorithm}
\label{alg:query-verify}
\end{multicols}
\end{algorithm*}
\end{document}