\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em










\textbf{Data}: \\

\For{$\omega = 1,2, \cdots, N$}{
Vectors $Z_n=(z_{1},\cdots , z_{n})$:
$x = y + z$

\If{$\tau \in \{\chi\}$ in $\sigma$}{       




I have the following problem in the algorithm as I want to group statements under Vectors and I don't want to number the "if" statement as it's part of group under Vectors below,

enter image description here

This is what I want,

![enter image description here

  • 3
    Does this answer your question? How to hide specific line numbers in an algorithm?
    – Marijn
    Apr 14 at 12:30
  • There is also tex.stackexchange.com/questions/223353/… which does something very similar to the proposed duplicate.
    – Marijn
    Apr 14 at 12:32
  • 1
    The answers you've shared hide the lines rather than not count them. The result in OP's case would be lines 1 2 3 7. The last end would be 7 and lines 4 -6 would be hidden. We want the counting to stop and resume on the last end. Also, they are with algorithm2e rather than algorithmicx, So I voted to keep open
    – Elad Den
    Apr 14 at 14:46
  • 1
    UGH just noticed OP was using algorithm2e... Still not the answer he was looking for though
    – Elad Den
    Apr 14 at 14:57
  • 1
    I've tried this answer tex.stackexchange.com/a/153906/90297 , but it also numbers the first end. If you could go with no ends, then that's fine, or find some way to redefine nonl in the end block somehow
    – Elad Den
    Apr 14 at 15:59

Your Answer

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

Browse other questions tagged or ask your own question.