1

I'm using this answer to indent the chapters of my appendix as sections in the table of contents. Before my appendices, I added:

\makeatletter
\addtocontents{toc}{\let\protect\l@chapter\protect\l@section}
\makeatother

So my body is:

\input{discussion/discussion}

\appendix
\begin{appendices}
\makeatletter
\addtocontents{toc}{\let\protect\l@chapter\protect\l@section}
\makeatother
\input{appendix/walking-statistics}
\input{appendix/standing-statistics}
\end{appendices}

\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{alpha}
\bibliography{bibliography/HRG}

This results in a TOC like:

5  Chapter
    5.1  Section 1
    5.2  Section 2
Appendices
    A  Lorem Ipsum
    B  Lorem Ipsum II
    Bibliography

However, I want to have my bibliography at the top level of the table of contents:

5  Chapter
    5.1  Section 1
    5.2  Section 2
Appendices
    A  Lorem Ipsum
    B  Lorem Ipsum II
Bibliography

But I can't figure out how to essentially "undo" the change in the way that chapters are organized in the table of contents.

1

Change the \addtocontents command to

\addtocontents{toc}{\bgroup\let\protect\l@chapter\protect\l@section}

and add the following line at the end of your appendices environment:

\addtocontents{toc}{\egroup}

This delimits the effect of the \let statement to the area between \bgroup and \egroup.

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.