[Tex/LaTex] parskip package, keep the indents

indentationparagraphsparskip

That may be a stupid question but is there a way to keep the indent while using the parskip package? I use parskip to keep spacing between my paragraphs while leaving the table of contents and lists intacts but I would like to keep the indents in my text.

Code 1 :

\usepackage{parskip}

\tableofcontents

\section{Section 1}
\subsection{Sub 1}

Paragraph 1

Paragraph 2

Code 2

\setlength{\parskip}{10pt}

\tableofcontents

\section{Section 1}
\subsection{Sub 1}

Paragraph 1

Paragraph 2

Basically I want the aspect of the table of contents (and possible lists) from the code 1 while keeping the indent like in the code 2. The package parskip works great but I just don't like that it deletes the indents and I'd like to find a way to prevent it from doing that.

Thank you.

Best Answer

Package parskip sets \parindent to zero. The following example saves the old value, loads parskip and restores \parindent:

\documentclass{article}

\edef\restoreparindent{\parindent=\the\parindent\relax}
\usepackage{parskip}
\restoreparindent

\begin{document}
\tableofcontents

\section{Section 1}
\subsection{Sub 1}

Paragraph 1

Paragraph 2
\end{document}

Result