I would like to hide the Algorithm environment as shown in the attached pic below. That is please remove "Algorithm 8.1" which is highlighted in blude.

enter image description here

The code is provided below:

    \begin{tabular}{| l ||l| }
        \multicolumn{2}{|l|}{\textbf{ Algorithm \ref{al:8.1}: Obtaining weights (Off-line)}} \\
        \textbf{INPUT } &  $\omega_{k}^{j}, (k<m)$, $\phi(l,k)$, $H_l^j$, $R_l^j$ \\
        \textbf{OUTPUT} & $\omega_{k}^{j} (k\geq m)$ \\
        1 & \textbf{INITIALIZE } $\omega_{k}^{j}, (k<m)$ \\
        2 & \textbf{FOR} each $k\geq m$ \textbf{DO} OP \ref{op:8.1} \\
        3 & \textbf{STORE} $\omega_{k}^{j}$ \\
        4 & $k$ $\gets$ $k+1$ \\
        5 & \textbf{GOTO} 2\\
        6 & \textbf{END}\\

Please help!

1 Answer 1


You do not need the tabular environment to specify an algorithm in LaTex. Use some packages like and . Here is an example of the algorithm in your picture, where the definition of the for each loop comes from here https://tex.stackexchange.com/a/149166.




  \State \textbf{Initialize} #1

  \State \textbf{Store} #1

  \State \textbf{Goto} #1

% for each loop
% based on: https://tex.stackexchange.com/a/149166
\algnewcommand\algorithmicforeach{\textbf{for each}}
\algdef{S}[FOR]{ForEach}[1]{\algorithmicforeach\ #1\ \algorithmicdo}

% algorithm number based on section

% set section number to 8

    \caption{Obtaining weights (Off-line)}
        \Require{$\omega_{k}^{j}, (k<m)$, $\phi(l,k)$, $H_l^j$, $R_l^j$}
        \Ensure{$\omega_{k}^{j} (k\geq m)$}
        \Initialize{$\omega_{k}^{j}, (k<m)$}
        \ForEach{$k \geq m$}\label{alg:8.1_line2}
        \State{$k$ $\gets$ $k+1$}

% to have a reference for op:8.1

Output result

You must log in to answer this question.

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