我使用以下代码生成一篇包含补充材料的论文。我只想要一个补充部分的目录。但是,如您所见,目录列出了参考论文正文部分也是如此。我们如何避免这种情况?谢谢。
\documentclass[prl,twocolumn]{revtex4-1}
%\documentclass[twocolumn]{article}
\usepackage{hyperref}
\begin{document}
\title{My Title}
\author{my name}
\affiliation{Somewhere}
\begin{abstract}
my abstract
\end{abstract}
\maketitle
\textit{Introduction.---}%
We have many things to say\cite{Giuliani2005SM}.
\begin{thebibliography}{95}%
\bibitem{Giuliani2005SM}
G.F. Giuliani and G. Vignale,
\textit{Quantum theory of the electron liquid} (Cambridge University Press, 2005).
\end{thebibliography}%
%Start Supplemental Material
%%%%%%%%%% Merge with supplemental materials %%%%%%%%%%
%\newpage
\onecolumngrid
%\newpage
{
\center \bf \large
Supplemental Material\vspace*{0.1cm}\\
\vspace*{0.0cm}
}
\twocolumngrid
\tableofcontents
\section{A section}\label{App:section}
haha\cite{Hanamura1970SM}
\begin{thebibliography}{9}
\bibitem{Hanamura1970SM} E. Hanamura, J. Phys. Soc. Jpn. {\bf 29}, 50 (1970).
\end{thebibliography}
\end{document}
答案1
为了避免thebibliography
在目录中设置类似节的条目,请将以下内容包裹在其周围:
\let\oldaddcontentsline\addcontentsline% Store \addcontentsline
\renewcommand{\addcontentsline}[3]{}% Make \addcontentsline a no-op
\begin{thebibliography}{X}%
% <bibitems>
\end{thebibliography}%
\let\addcontentsline\oldaddcontentsline% Restore \addcontentsline
上述序列存储\addcontentsline
然后重新定义为不执行任何操作。这样,就不会将任何内容作为环境的一部分写入 ToC thebibliography
。最后,我们\addcontentsline
在环境之后进行恢复。