TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm confused in how I might go about writing a command to create an indention in LaTeX.

For example, I am making an outline, and I want the Main Points to have an \hspace of 30pt. How do I create a command (\main) that will allow me to do that consistently throughout my document?

I am trying to learn LaTeX, but even this simple task is eluding me.

\newcommand{\main}          %% I know this is wrong
share|improve this question

migrated from stackoverflow.com Jun 7 '11 at 13:54

This question came from our site for professional and enthusiast programmers.

The first row of each paragraph has been indented by default. If you need to change the indentation space, modify the existing indentation space definition at the preamble. The change will be reflected throughout the document automatically. – xport Jun 7 '11 at 14:08

If you need that your paragraph introduced by \main is exactly 30pt from the left margin, you can define


With \par you are sure to start a new paragraph, with \noindent you disable the automatic indentation, with \hspace*{30pt} you insert the desired spacing. I've added \ignorespaces though it's not necessary here because if you try a different definition, for instance by adding a title in bold face, with


you don't incur in the spurious space that would be introduced by an input such as

\main{Item} text

without \ignorespaces.

You should consider, however, a list environment, for your outline. For example


and input your items as

 \item First element
 \item Second element
share|improve this answer

You should be able to use the built in \indent if you want to indent individual paragraphs. If you want LaTeX to automatically indent the start of all starting paragraphs, you can use the indentfirst package to indent the first paragraph. And if you want to change the indentation length you can use \setlength{\parindent}{0.25in}

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.