# Algorithmic in Latex [duplicate]

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, MicoAug 7 '15 at 1:19

• 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.