260

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?

6
  • 27
    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. Dec 19, 2011 at 21:57
  • 9
    It feels like you did not actually try your sample code with \noindent, since it works.
    – Ryan Reich
    Dec 19, 2011 at 22:46
  • 4
    @RyanReich You are correct, I did not even try \noindent. I just used the '\noindent' example to illustrated the kind of solution I was looking for. I did not realize it would actually work! Dec 20, 2011 at 0:46
  • 11
    This is an excellent example of why you should experiment before posting a question.
    – Seamus
    Dec 20, 2011 at 14:56
  • 8
    @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, 2012 at 8:52

1 Answer 1

281

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}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .