0

So I'm trying to create an indent in an algorithm, but I'm not familiar with the \begin{algorithm} environment, so I would just like to do it in a math environment. I'm trying to create an indent, but the code below doesn't seem to work. Please help?

 \documentclass{article}  
 \begin{document}  
 $S=\emptyset;\ i=k=1;\ N[j]=Z[j]=S^*[j]=COMP[j]=0;\ j=1,2,...,11\\   
 j=1.\\  
 \hspace{4ex} VISIT(1)....$  
 \end{document}
  • 3
    You have to use \hspace* (starred version). Anyway the result is awful... – karlkoeller Feb 24 '14 at 11:29
  • If you tell us what you're trying to achieve, probably an answer using algorithm-specific packages will appear... – karlkoeller Feb 24 '14 at 11:44
  • Thanks! I didn't know about the starred version. And believe it or not, the result is exactly what I wanted, just a small indent, going only 2 layers deep. – RBS Feb 24 '14 at 11:57
  • 2
    So the question can be closed as a duplicate of this one? tex.stackexchange.com/q/89082/27635 – karlkoeller Feb 24 '14 at 12:01
  • You are setting mult-letter identifiers such as VISIT in math italic, which is all wrong you need \mathrm or \mathit, similarly ... should be \ldots – David Carlisle Feb 24 '14 at 20:03