0

I started numbering a document after two sections, and want them to be removed from the TOC.

what I have is the following: enter image description here

I would like to obtain:

enter image description here

this is the latex script I'm using:

\documentclass[12pt,a4paper]{revtex4-1}
\usepackage{graphicx}% Include figure files
\usepackage{bm}% bold math
\usepackage[usenames]{color}
\usepackage[all]{xy}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage{placeins}
\usepackage{verbatim}
\usepackage[top=0.59in,bottom=0.59in,left=0.59in,right=0.59in]{geometry}
\usepackage{amssymb}
\usepackage{float}
\usepackage{multirow}
\setlength{\parindent}{0pt}
\setlength{\abovecaptionskip}{0pt plus 0pt minus 0pt}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\alph{subsection}}
\begin{document}
\thispagestyle{empty}
\newpage
\section*{Abstract}
\thispagestyle{empty}
Some text
\newpage
\section*{List of abbreviations}
\thispagestyle{empty}
Some text
\newpage
\thispagestyle{empty}
\setcounter{figure}{0} \renewcommand{\thefigure}{\arabic{figure}}
\setcounter{table}{0} \renewcommand{\thetable}{\arabic{table}}
\newpage
\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\thispagestyle{empty}
\newpage
\setcounter{page}{1}
\section*{Introduction}
Some text
\section*{Goals}
Some text
\end{document}

thank you

  • Hi, please post a MWE that illustrates your problem. – Troy Mar 17 '17 at 14:45
  • You should offer us a mwe or at least your documentclass. Otherwise we have to guess. – Jürgen Mar 17 '17 at 14:45
  • 1
    What about using \section*{}? – TeXnician Mar 17 '17 at 14:52
  • Added MWE in the question, cheers – jarhead Mar 17 '17 at 15:00
  • Why xcolor and color? Why not loading hyperref at the end of the preamble? – user31729 Mar 17 '17 at 16:02
2

Apparently some sections should not appear in the ToC (and not removing the section numbers), so use the \tocdepth@munge and \tocdept@restore commands, written to the ToC.

\documentclass[12pt,a4paper]{revtex4-1}
\usepackage{graphicx}% Include figure files
\usepackage{bm}% bold math
\usepackage[usenames]{color}
\usepackage[all]{xy}
\usepackage{amsmath}
\usepackage{natbib}
\usepackage{placeins}
\usepackage{verbatim}
\usepackage[top=0.59in,bottom=0.59in,left=0.59in,right=0.59in]{geometry}
\usepackage{amssymb}
\usepackage{float}
\usepackage{multirow}
\usepackage{blindtext}
\setlength{\parindent}{0pt}
\setlength{\abovecaptionskip}{0pt plus 0pt minus 0pt}
\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\alph{subsection}}
\begin{document}
\thispagestyle{empty}
\clearpage
\makeatletter
\addtocontents{toc}{\string\tocdepth@munge}
\section*{Abstract}
\thispagestyle{empty}
Some text
\clearpage
\section*{List of abbreviations}
\thispagestyle{empty}
\addtocontents{toc}{\string\tocdepth@restore}
\makeatother
Some text
\newpage
\thispagestyle{empty}
\setcounter{figure}{0} \renewcommand{\thefigure}{\arabic{figure}}
\setcounter{table}{0} \renewcommand{\thetable}{\arabic{table}}
\clearpage

\thispagestyle{empty}
\tableofcontents
\thispagestyle{empty}
\cleardoublepage
\thispagestyle{empty}
\clearpage
%\setcounter{page}{1}
\section{Introduction}
\blindtext[5]
\section{Goals}
\blindtext[5]
\end{document}

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.