I use \setlength{\parskip}{\baselineskip} and it is great. But I want to disable it just for the \tableofcontents. Is it possible?


I think the more general idea here is that you have a length that is set in the preamble, but want it to be different for a specific part of your document.

For this, store the length before setting it using something like

\setlength{\storeparskip}{\parskip}% Store \parskip
\setlength{\parskip}{\baselineskip}% Set \parskip

Then, where you need the adjusted \parskip to be restored, use

\setlength{\parskip}{\storeparskip}% Restore \parskip within this scope

The scoping (via an explicit \begingroup...\endgroup pair, or using {...}) will restore the lengths to their pre-scope values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.