For my masters thesis I would like to have a TOC list but hide the chapter, section and subsection from the PDF document. Is there any way to do that.

In other words. \subsection*{subsection} hides it from TOC, is there any reverse method as to hide from document body but show in TOC ?

Best, Abhi

  • 5
    Does this question help you? tex.stackexchange.com/questions/86082/… – egreg Jan 1 '13 at 14:42
  • Do you want the sectioning headers (of level section, subsection, etc) to disappear completely from the body of the text, or should they be there but not numbered? – Mico Jan 1 '13 at 14:49

The only way that I can think to do this, is to create new commands that add the items to the TOC, and increment (or reset) the counters, but dont add to the actual document.

In the below code, I have called the standard chapter and section commands once, then called the \newchapter{...} and \newsection{...} custom commands. You will see standard TOC, yet only one chapterpage and section header.

The only thing that is perhaps a little unsatisfactory, needs more work, is the spacing in the TOC, since the numbers were physically added in the \newchapter and \newsection commands, otherwise they would have been left out and I couldn't think off the top of my head what the commands are to call the TOC spacings.

[For the Record, I don't actually think this is a good idea, since the whole point of a TOC is to allow the reader to direct themselves to particular sections and subsections etc. Without the headings, your readers will, in all likelihood, get confused.]

Here is what the TOC Looks Like:


Here is what the First Chapter and Section Looks Like:


Here is what the Second Chapter and Section Looks Like:

enter image description here

Finally, Here is the code to achieve the above.



\chapter{First Chapter - Standard}
\section{First Section - Standard}



\newchapter{Second Chapter - Modified}
\newsection{Second Section - Modified}


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.