13

I am using the document class article. Once I place a part in the document, all subsequent sections belong to the part automatically. How can I reset a section such that it does not belong to a part?

The following sample demonstrates what I want to achieve:

\section{Introduction}

\part{Part 1}
\section{Section 1 belonging to part 1}
\section{Section 2 belonging to part 1}

\part{Part 2}
\section{Section 1 belonging to part 2}
\section{Section 2 belonging to part 2}

% should not belong to Part 2
\section{Conclusion}
3
  • 1
    what do you mean by "belong"? editing your code to make it actually run (an mwe would have been better), i see exactly what i would expect -- what is it that you would expect (or like). Commented Sep 25, 2012 at 10:11
  • Are you perhaps referring to the PDF bookmarks?
    – egreg
    Commented Sep 25, 2012 at 14:08
  • 1
    @egreg: Yes, I'm referring to PDF bookmarks as well as the layout of the TOC. In the default TOC formatting, the sections of a part are separated from other parts by greater spacing before and after. Commented Sep 27, 2012 at 21:28

2 Answers 2

12

The \bookmarksetup instruction will lift the final section one level up in the PDF bookmarks; the \addtocontents instruction will leave the same space in the TOC as before parts.

\documentclass{article}
\usepackage{hyperref}
\usepackage{bookmark}
\begin{document}

\tableofcontents

\section{Introduction}

\part{Part 1}
\section{Section 1 belonging to part 1}
\section{Section 2 belonging to part 1}

\part{Part 2}
\section{Section 1 belonging to part 2}
\section{Section 2 belonging to part 2}

\addtocontents{toc}{\protect\addvspace{2.25em plus 1pt}}
\bookmarksetup{startatroot}
\section{Conclusion}
\end{document}
3

I'm not sure, what you want exactly. You might want the starred form of \section and reset the section-counter:

\documentclass{report}

\begin{document}
\section*{Introduction}

\renewcommand{\thesection}{\arabic{part}.\arabic{section}}
\part{Part 1}
\section{Section 1 belonging to part 1}
\section{Section 2 belonging to part 1}

\setcounter{section}{0}
\part{Part 2}
\section{Section 1 belonging to part 2}
\section{Section 2 belonging to part 2}

% should not belong to Part 2
\section*{Conclusion}
\end{document}

You may want to add a clearpage before the Conclusion section as well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .