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

  • Context: LaTeX 
  • Thread starter Thread starter Amok
  • Start date Start date
  • Tags Tags
    Horizontal Latex
Click For Summary
SUMMARY

The discussion focuses on effective methods for adding horizontal spacing in LaTeX text specifically for pseudo-code writing. The user initially attempted to use the \hspace command but found it ineffective for their needs. They explored alternatives such as the verbatim environment and the listings package, ultimately discovering that the commands \mbox{\quad} and \mbox{\qquad} provided the desired spacing. The user explicitly stated that they do not wish to utilize the algorithm environment.

PREREQUISITES
  • Familiarity with LaTeX syntax and commands
  • Understanding of pseudo-code formatting requirements
  • Knowledge of the verbatim environment in LaTeX
  • Experience with the listings package for code representation
NEXT STEPS
  • Research the usage of the verbatim environment in LaTeX
  • Explore the listings package for advanced code formatting options
  • Learn about custom spacing commands in LaTeX, such as \hspace and \quad
  • Investigate alternative environments for pseudo-code representation in LaTeX
USEFUL FOR

LaTeX users, technical writers, and educators looking to format pseudo-code effectively in their documents.

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 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K