1
\begin{algorithm}[tb]

\scriptsize $\prod_m$: Manipulated Call Trace,
\scriptsize $\prod_n$: Natural Call Trace     \\
\scriptsize $\Delta_m$: Unaligned Call Trace in $\prod_m$,
\scriptsize $\Delta_n$: Unaligned Call Trace in $\prod_n$, \\
\scriptsize $f_{\prod}$: $\langle name,caller\ eip,parameter\ list\rangle$,
\scriptsize $f_{\Delta}$: $\langle name,parameter\ list\rangle$

\begin{algorithmic}[1]                   % enter the algorithmic environment
\caption{Differential Analysis on the API-Call Traces}
\label{algo:diff}
    $\Delta_m\leftarrow  \emptyset$,$\Delta_n \leftarrow  \emptyset$

\For{call $f_{\prod_m}$ in $\prod_m$}{
    \For{call $f_{\prod_n}$ in $\prod_m$}{
        \If {isAligned($f_{\prod_m}$,$f_{\prod_n}$)}{
         GOTO FIND\_ALIGNED
        }
    }
 $\Delta_m=\Delta_m \bigcup f_{\Delta_m}$
}
 $\Delta_n=\prod_n$
 FIND\_ALIGNED:
        $\Delta_n= \prod_m[0,index(f_{\prod_n})]$
        $\{f_{\Delta_i}\}$=Diff($\Delta_m$,$\Delta_n$)
    return $\{f_{\Delta_i}\}$
    \end{algorithmic}
\end{algorithm}

showing error: You can't use `\prevdepth' in horizontal mode. \nointerlineskip ->\prevdepth -\@m \p@ l.100

$\Delta_n=\prod_n$ 

I am using algorithm2e package.

2
  • Welcome to TeX.SX! \FOR does not exist, did you mean \For? Notice that LaTeX commands are case sensitive.
    – TeXnician
    Commented Aug 17, 2018 at 20:37
  • welcome me to TeX SX! :p yeah I meant \For I have edited the code! New issue: You can't use `\prevdepth' in horizontal mode. \nointerlineskip ->\prevdepth -\@m \p@ l.100 $ \Delta_n=\prod_n$
    – Md Sajid
    Commented Aug 17, 2018 at 20:54

1 Answer 1

2

You cannot combine the use of algorithm2e and content from the algorithms bundle (which includes the algorithmic package/environment) or algorithmicx. It's either algorithm2e or something else.

By looking at your syntax, it seems you are favouring algorithm2e:

enter image description here

\documentclass{article}

\usepackage[linesnumbered]{algorithm2e}
\DontPrintSemicolon

\begin{document}

\begin{algorithm}[tb]
  \caption{Differential Analysis on the API-Call Traces}

  \LinesNotNumbered
  $\prod_m$: Manipulated Call Trace,
    $\prod_n$: Natural Call Trace\;
  $\Delta_m$: Unaligned Call Trace in $\prod_m$,
    $\Delta_n$: Unaligned Call Trace in $\prod_n$, \;
  $f_{\prod}$: $\langle$ name, caller eip, parameter list$\rangle$,
    $f_{\Delta}$: $\langle$ name, parameter list$\rangle$

  $\Delta_m\leftarrow  \emptyset$,$\Delta_n \leftarrow  \emptyset$

  \For{call $f_{\prod_m}$ in $\prod_m$}{
    \For{call $f_{\prod_n}$ in $\prod_m$}{
      \If{isAligned($f_{\prod_m}$, $f_{\prod_n}$)}{
      GOTO FIND\_ALIGNED
      }
    }
    $\Delta_m = \Delta_m \bigcup f_{\Delta_m}$\;
  }
  $\Delta_n = \prod_n$\;
  FIND\_ALIGNED:\;
  \Indp
    $\Delta_n = \prod_m[0, \mbox{index}(f_{\prod_n})]$\;
    $\{f_{\Delta_i}\}$ = Diff($\Delta_m$, $\Delta_n$)\;
    return $\{f_{\Delta_i}\}$\;
\end{algorithm}

\end{document}

You'll have to sort out the line numbering and formatting of the caption, since they change depending on whether you use algorithm2e or something else. There are examples contained within the algorithm2e documentation.

1
  • Wow! thank you very much that worked! Yeah messed it up with the use of algorithm2e and content from the algorithms bundle (which includes the algorithmic package/environment) or algorithmicx
    – Md Sajid
    Commented Aug 17, 2018 at 21:58

You must log in to answer this question.

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