2

I cannot insert comments using the \comment{} annotation, here is my code below:

\documentclass[conference]{IEEEtran}
 \IEEEoverridecommandlockouts
\usepackage{cite}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{graphicx}

\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{multirow}
\setlength{\textfloatsep}{0.1cm}

 \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
 T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
 \begin{document}

\begin{algorithm}
\caption{SurroundednessPattern}
\begin{algorithmic}[1]
    \raggedright
    \FORALL{methodTrace in methodTraceList}   

    \comment{this is a comment}
    \IF {$!$methodtrace.Method.Callees.isEmpty() 
    } \STATE methodTrace.Prediction=T

    \ENDIF 
    \ENDFOR 

\end{algorithmic}
\label{surroundedness}
\end{algorithm}

\end{document}
1
  • 1
    The \def\BibTeX{...} part is completely useless; remove it.
    – egreg
    Commented Dec 27, 2018 at 15:23

1 Answer 1

4

Use

\STATE \COMMENT{this is a comment}

A \COMMENT command cannot be used by itself, but needs to be in some other construct.

\begin{algorithmic}[1]
    \raggedright
    \FORALL{methodTrace in methodTraceList}
    \STATE \COMMENT{this is a comment}
    \IF {$!$methodtrace.Method.Callees.isEmpty()
    } \STATE methodTrace.Prediction=T

    \ENDIF
    \ENDFOR

\end{algorithmic}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .