2

If you use both tocloft and parskip packages, a warning is generated about the redefinition of \@starttoc.

The MWE is straightforward. This code

\documentclass{article}
\usepackage{parskip}
\usepackage{tocloft}
\begin{document}
    \tableofcontents
    \section{Section}
    Some text
\end{document}

generates the warning

Package tocloft Warning: \@starttoc has already been redefined; tocloft bailing out. on input line 1147.

while, reverting the loading order of the two packages, the warning becomes

LaTeX Warning: Command \@starttoc  has changed. Check if current package is valid.

I looked inside the code of the two packages, and they look quite similar in the definition of \@starttoc. Nonetheless, the output PDF looks exactly the same.

Is it safe to ignore this warning? Otherwise how can it be removed? Thank you!

3

The redefinitions in the two packages are different. The parskip package makes sure that in the ToC the \parskip is zero (which it is in most documents). The tocloft package adds hooks at the start and end of the ToC but does nothing with the \parskip. You are probably OK if you call tocloft before parskip and ignore parskip's warning. If you call parskip before tocloft then tocloft capabilities will not be available in your document. Others might give better answers as to how to use the two packages together.

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.