[Tex/LaTex] Cancel/undo a \setlength{\parindent}{3ex}

indentationparagraphsparskip

Assume I want to have a section within an article with different indentation/parskipping. Is there a way to undo that command at the end of the section so the next section behaves again as if I never used a setlength on parindent?

I mean I could just use the \setlength{\parindent}{}-command again with the default parameters but what if I don't know the standard parameters of latex?

\documentclass{article}
\usepackage{ngerman, blindtext}
\begin{document}
\section{Section with different settings}

\setlength{\parindent}{0cm}\setlength{\parskip}{4ex plus 0.3ex minus 0.1ex}

\blindtext\par\blindtext
%Here I would want to undo the setlength command from above and go back to default
\section{Section back to default settings}

\blindtext\par\blindtext
\end{document}

Best Answer

Enclose the section in question within a group.

\documentclass{article}
\usepackage{ngerman, blindtext}
\begin{document}

\begingroup
\section{Section with different settings}

\setlength{\parindent}{0cm}\setlength{\parskip}{4ex plus 0.3ex minus 0.1ex}

\blindtext\par\blindtext
\endgroup

%Here I would want to undo the setlength command from above and go back to default
\section{Section back to default settings}

\blindtext\par\blindtext
\end{document}