I am trying to write an IEEE Access paper by using the template on their website. But I am having trouble writing my pseudocodes since there is no pseudocode example in their template. When I use ieeeaccess template I got error messages such as:
"Extra \endcsname. \State",
"Undefined control sequence. \doWhile",
"Missing \endcsname inserted. \State".
Also, the result does not look as it should be. For instance, all line numbers are zeros in the pseudocode. Also instead of "input" and "output", I got "require" and "ensure" after compiling the .tex file.
Am I missing some userpackage?(although I have tried many combinations still no results) Can someone please give me an example of ieeeaccess pseudocode along with the required userpackages?
\documentclass{ieeeaccess}
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage[section]{placeins}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{algorithmicx}
\algdef{SE}[DOWHILE]{Do}{doWhile}{\algorithmicdo}[1]{\algorithmicwhile\ #1}%
\begin{document}
\begin{algorithm}[H]
\caption{Algorithm 1}\label{Alg-Decap}
\begin{algorithmic}[1]
\Require{$(C,S_k)$}
\Ensure{ HashSession$(1,\underbar r,C)$ or HashSession$(0,\rho,C))$ }
\State $c\leftarrow$ Decode$(\underbar c)$
\State $c.(3f)\in\mathcal{R}/q$
\State $e\leftarrow $ (Rounded$(c.(3f))$ mod 3) $\in \mathcal{R}/3$
\State $e.(1/g)\in\mathcal{R}/3$
\State $r'\leftarrow$ Lift($e.(1/g)$) $\in\mathcal{R}/q$
\State $h.r'\in\mathcal{R}/q$
\State $c'\leftarrow$ Round$(h.r')$
\State $\underbar c'\leftarrow$ Encode$(c')$
\State $C'\leftarrow(\underbar c',$ HashConfirm$(\underbar r',\underbar h))$
\If{$C'==C$}
\State \textbf{return} HashSession$(1,\underbar r,C)$
\Else
\State \textbf{ return} HashSession$(0,\rho,C))$
\EndIf
\end{algorithmic}
\end{algorithm}
\end{document}
article
class when I removealgorithmic
– daleif Nov 5 '20 at 15:23article
I also get a different error:! LaTeX Error: Command \algorithmic already defined. Or name \end... illegal, see p.192 of the manual.
which hints that this is a compatability problem between packages – daleif Nov 5 '20 at 15:26algorithmic
. – campa Nov 5 '20 at 15:28