I use the following code to generate a paper with its supplemental material. I only want a table of contents for the supplementary part. However, as you see, the table of contents lists the References of the paper main text part as well. How can we avoid this? Thanks. enter image description here


\title{My Title}
\author{my name}

my abstract

We have many things to say\cite{Giuliani2005SM}.

    G.F. Giuliani and G. Vignale, 
    \textit{Quantum theory of the electron liquid} (Cambridge University Press, 2005).

%Start Supplemental Material

%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
    \center \bf \large 
    Supplemental Material\vspace*{0.1cm}\\ 


\section{A section}\label{App:section}

    \bibitem{Hanamura1970SM} E. Hanamura, J. Phys. Soc. Jpn. {\bf 29}, 50 (1970).



To avoid thebibliography from setting a section-like entry in the ToC, wrap the following around it:

\let\oldaddcontentsline\addcontentsline% Store \addcontentsline
\renewcommand{\addcontentsline}[3]{}% Make \addcontentsline a no-op
  % <bibitems>
\let\addcontentsline\oldaddcontentsline% Restore \addcontentsline

The above sequence stores \addcontentsline and then redefines it to do nothing. This way nothing gets written to the ToC as part of the thebibliography environment. Finally, we restore \addcontentsline after the environment.

enter image description here


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.