0

I apologize if this has been asked before, but none of the other TOC questions seemed to precisely match what I am looking for.

I would like to, with as minimal as possible changes to the standard usage of the TOC package, create a TOC that alters just one chapter (the introduction).

For example with the following MWE of my current set up:

\documentclass{book} 
\usepackage{hyperref}
\begin{document}

\tableofcontents

\chapter{Preamble}

\section{Motivation}
\section{Outline}

\chapter{Blah}
\section{Blah}
\section{Blah}

\chapter{Blah}
\section{Blah}
\section{Blah}
\end{document}

I get this output

1 Preamble
 1.1 Motivation
 1.2 Outline
2 Blah
 2.1 Blah
 2.2 Blah
3 Blah
 3.1 Blah
 3.2 Blah

Where what I would like is

  Preamble
     Motivation
     Outline
1 Blah
 1.1 Blah
 1.2 Blah
2 Blah
 2.1 Blah
 2.2 Blah

And it still be hyperlinked.

Thanks!

1

Here is a simple solution:

\documentclass{book}

\begin{document}


\tableofcontents
{\renewcommand\thesection{\arabic{section}}
\chapter*{Preamble}
\addcontentsline{toc}{chapter}{{\hspace*{1.3em}Preamble}}

\section{Motivation}
\section{Outline}
}

\chapter{Blah}
\section{Blah}
\section{Blah}

\chapter{Blah}
\section{Blah}
\section{Blah}

\end{document} 

enter image description here

  • Dear Bernard, thanks for your help! Unfortunately, that doesn't work. Namely, I realized that I forgot to mention that I am using \usepackage{hyperref} which seems to screw the whole affair up. I've editied accordingly. Sorry! – Alex Youcis Nov 21 '15 at 1:12
  • There must be something else. Adding hyperref still works here with my code. Could you post a minimal non-working example? – Bernard Nov 21 '15 at 1:35
  • It was no problem! I just made a slight mistake when typing in what you had written. Thanks! – Alex Youcis Nov 30 '15 at 3:58

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.