186

Is there a way to remove the indentation at the beginning of a paragraph for a single paragraph. I know I could do

\setlength{\parindent}{0cm}
This is my paragraph.  Blah blah blah.
\setlength{\parindent}{default}

Where default is whatever the default indentation is for the document class I am using (part of the problem is that I don't know what this default value is). I feel as if there should be a better way to accomplish this than by the above method. I am looking for a solution of the form:

\noindent
This is my paragraph.  Blah blah blah.

Is there a way to do this, or will I have to resort to the former method? If I have to resort to the former method, what is the default indentation value for the amsart document class?

  • 25
    Are you saying that \noindent does not work for you? If so, can you provide a a fully compilable MWE that illustrates the problem including the \documentclass. – Peter Grill Dec 19 '11 at 21:57
  • 2
    You can see the default indentation by using \the\parindent, normally defined as 1.5em for full width text and 1em for two column. – mathspasha Dec 19 '11 at 21:57
  • 9
    It feels like you did not actually try your sample code with \noindent, since it works. – Ryan Reich Dec 19 '11 at 22:46
  • 10
    This is an excellent example of why you should experiment before posting a question. – Seamus Dec 20 '11 at 14:56
  • 6
    @Seamus: and/or an excellent example of how when you think a command name you would like to use with TeX is actually exactly the same-named that is already existing! :D – morbusg Oct 17 '12 at 8:52
206

As the example below illustrates, \noindent suppresses paragraph indentation when used at the beginning of a paragraph. If used in the middle of a paragraph, it is ignored and does not suppress the paragraph indentation.

Also, you can always group things within a {} so that any settings within their are not in effect after the group. This saves you from having to store the old setting and restore it afterwards.

enter image description here

Notes:

  • One can use \indent to produce a horizontal space equal to the width of the paragraph indentation.
  • The [showframe] option was used with the geometry package to show the margins so that the indentation is clearly shown.

Code:

\documentclass{article}
\usepackage[showframe]{geometry}

\begin{document}
This is my paragraph 1 and is indented.  Blah blah blah.

\noindent
This is my paragraph 2 but is not indented since it was started with noindent.  Blah blah blah.

This is my paragraph 3 and is indented.  Blah blah blah.

{\setlength{\parindent}{0cm}
This is my paragraph 4 but is not indented since parindent was set to 0 within this group.  Blah blah blah.
}

This is my paragraph 5 and is indented since the above setlength was within a group.  Blah blah blah.
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.