1

I want to disable line number in pseudo-code blocks, even though there isn't 1 in the \begin block. I am using the IEEE template

enter image description here

This is the code

\begin{algorithm}
\caption{Test}
\begin{algorithmic}

\State $test$ \State $test$ \State $test$ \State $test$

\end{algorithmic} \end{algorithm}

I have these packages:

\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{algpseudocode}
  • Reordering the package requirements in the preamble fixed the issue. The (assuming) correct order is :
    \usepackage{algpseudocode}
    \usepackage{algorithmic}
    \usepackage{algorithm}
    
    – Aleksandar Ivanovski Feb 04 '22 at 07:41
  • 1
    You don't need algorithmic, only \usepackage{algorithm,algpseudocode}. – Werner Feb 04 '22 at 07:47

1 Answers1

1

You're mixing packages that don't interact well. algorithm is from the algorithms bundle (which also provides algorithmic) and only provides the algorithm float. Then you need algpseudocode (from algorithmicx) which supplies the algorithmic environment and associated pseudocode commands (like \State, \If, \While, ...).

enter image description here

\documentclass{IEEEtran}

\usepackage{algorithm,algpseudocode}

\begin{document}

\begin{algorithm} \caption{Test} \begin{algorithmic} \State $test$ \State $test$ \State $test$ \State $test$ \end{algorithmic} \end{algorithm}

\end{document}

Werner
  • 603,163