LaTeX Effective Ways to Add Horizontal Spacing in Latex Text for Pseudo-code Writing

  • Thread starter Thread starter Amok
  • Start date Start date
  • Tags Tags
    Horizontal Latex
AI Thread Summary
To achieve horizontal spacing in text for pseudo-code formatting, using \hspace may not yield the desired results. Alternatives such as the verbatim environment and the listings package are suggested, with \mbox{\quad} and \mbox{\qquad} being effective for creating the necessary indentation. The algorithm environment is not suitable for this specific formatting need.
Amok
Messages
254
Reaction score
1
Hello guys, I'm trying to get some horizontal spacing into my text. I want to do this because I basically want to write a pseudo-code in my text, so I need every loop to start a bit further away from the beginning of the page than the previous one. I've tried \hspace, but it does not seem to work. And in case you're wondering, I don't to use the algorithm environment (it does not suit my purpose).

Thanks in advance.
 
Physics news on Phys.org
Only one that worked was \mbox{quad} or \mbox{qquad}. Thank you very much sir.
 

Similar threads

Replies
3
Views
3K
Replies
3
Views
4K
Replies
11
Views
5K
Replies
3
Views
2K
Replies
16
Views
4K
Replies
14
Views
2K
Replies
4
Views
3K
Replies
3
Views
2K
Back
Top