[Tex/LaTex] Remove Indentation for a Single Paragraph

indentation

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?

Best Answer

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}