Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable indentation in particular section in LaTeX?

I need to disable indentation in only one section of my document (subsection, to be specific). How can I do that?

Default indentation is provided by indentfirst package.

like image 746
Radek Wyroslak Avatar asked Nov 01 '10 22:11

Radek Wyroslak


People also ask

How do I change the indentation in LaTeX?

Paragraph indentation The \parindent command controls the indentation of paragraphs. To change the indentation document-wide, set \parindent in the document preamble to the desired value. To disable the indentation for a single paragraph, use \noindent at the beginning of the paragraph.

How do you indent a few lines in LaTeX?

Paragraph indent It is possible to override it by using the \setlength command. This will set paragraph indents to 1cm: \setlength{\parindent}{1cm} % Default is 15pt. at the beginning of the paragraph.


2 Answers

It depends on how pervasively you want to eradicate the indentation. But the first thing I'd try is setting \parindent to 0pt:

Some text with normal indentation...

{\parindent0pt % disables indentation for all the text between { and }

Text with no indentation.

Still no indentation.

}% restore indentation

Indented again.
like image 115
godbyk Avatar answered Oct 13 '22 18:10

godbyk


An environment that sets the indent could be a possible solution? You define it in the preamble like:

\newlength\mystoreparindent
\newenvironment{myparindent}[1]{%
\setlength{\mystoreparindent}{\the\parindent}
\setlength{\parindent}{#1}
}{%
\setlength{\parindent}{\mystoreparindent}
}

In your document you would then write something like:

\begin{myparindent}{0pt}
This paragraph is not indented, ehm well, actually it is indented by 0pt
which is the same as not indented.

And this paragraph neither\ldots
\end{myparindent}

Or if you want a large paragraph indent

\begin{myparindent}{5cm}
The first line of this paragraph is indented by 5 cm.

And so is the first line of the next paragraph.
\end{myparindent}
like image 28
Tjeerd Pinkert Avatar answered Oct 13 '22 17:10

Tjeerd Pinkert