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
    The \def\BibTeX{...} part is completely useless; remove it. – egreg Dec 27 '18 at 15:23
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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.