Remove indentation on paragraph in LaTeX

By default, LaTeX inserts a small indentation (usually about 5mm) at the beginning of each new paragraph. The indentation of new paragraphs is controlled by the \parindent length.

In this tutorial, I will show you how can you remove the default indentation globally and locally.

Remove indentation from paragraph globally

In order to remove the natural indentation from paragraphs globally you have to set the \parindent length to 0 using \setlength command. Like this.

\setlength{\parindent}{0cm}

\documentclass{article}
\usepackage{lipsum}
\setlength{\parindent}{0cm}
\begin{document} 

\lipsum[1]\par
\lipsum[1][1-8]

\end{document}

Output:

All paragraphs without indentation.

Remove indentation from a paragraph locally

If you want to remove indentation from a specific paragraph, in this case, you can use three different ways:

  • \begin{noindent} and \end{noindent}
  • \noindent
  • \setlength{\parindent}{0cm}{<text>}

 

\documentclass{article}

\begin{document}
This paragraph will be indented, because it is outside the\\ \verb|noindent| environment. This is a sentence.\\[4pt]

\begin{noindent}
  This paragraph will not be indented, because it is inside the\\ \verb|noindent| environment. This is a sentence.\\[4pt]
\end{noindent}

This paragraph will also be indented, because it is outside\\ the \verb|noindent| environment. This is a sentence.\\[4pt]

\noindent This paragraph will also not be indented, because we are using\\ \verb|\noindent| command. This is a sentence.\\[4pt]

\setlength{\parindent}{0cm}{This paragraph will also not be indented, because we are using\\ \verb|\setlength{\parindent}{0cm}| command. This is a sentence.}

\end{document}

Output:

Removed indentation for a specific paragraph.

Leave a Reply

Your email address will not be published. Required fields are marked *