This question already has an answer here:

I want to write:

{Step 6 
  for n = 0 to final do
  y(n) = x(n)
  e(k) = d(k) 􀀀 y(k)
  w(n + 1) = w(n) + x(n)e(n)
  end for}

My problem is for appears in the start without identation.

marked as duplicate by Werner, user13907, Gonzalo Medina, Symbol 1, Mico Aug 7 '15 at 1:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Null Jun 4 '15 at 16:07

You could use the minted package for code, which also provides syntax highligthing. Alternative you can create custom spaces with \quad or \qquad or \hspace{2mm} or ~, among some other ways.

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