Text FormattingDisabling indentation in particular section

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
radpl
Posts: 2
Joined: Tue Nov 02, 2010 12:25 am

Disabling indentation in particular section

Post by radpl »

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.
Last edited by radpl on Tue Nov 02, 2010 1:21 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Disabling indentation in particular section

Post by frabjous »

If it's just the first paragraph of that one section you don't want indented, then just use \noindent at the beginning of the paragraph.

If you don't want any identation throughout the (sub)section, then you could try something like this:

Code: Select all

\documentclass{article}
\usepackage{indentfirst}
\usepackage{lipsum}% for generating filler text
\begin{document}

\section{A section}
\lipsum[1-5]

\section{Another section}
\lipsum[6-10]

\section{Unindented section}
\newlength{\oldparindent}%
\setlength{\oldparindent}{\parindent}% save old indentation amount
\setlength{\parindent}{0em}% zero out indentation
\lipsum[11-15]

\setlength{\parindent}{\oldparindent}% return to old indent amount
\section{A Final Section}
\lipsum[16-20]
\end{document}
If that doesn't do what you want, then I think a minimal working example is in order.
radpl
Posts: 2
Joined: Tue Nov 02, 2010 12:25 am

Re: Disabling indentation in particular section

Post by radpl »

frabjous, your example perfectly works for me. Thank you very much!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Disabling indentation in particular section

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic (not the last post) accordingly as clearly written in Section 3 of the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Best regards and welcome to the board
Thorsten
Post Reply