Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Excluding chapters from ToC in amsbook

is it possible in LaTeX to have numbered chapters inside the appendix, without having them appear in the Table of Contents (TOC)?

share|improve this question

migrated from stackoverflow.com Aug 8 '12 at 19:26

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Werner, percusse, Martin Schröder, Marco Daniel, Tom Bombadil Aug 23 '12 at 20:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You can use {\renewcommand{\addtocontents}[2]{} \chapter{Appendix chapter}} to remove the appendix chapter from the ToC. Grouping the \renewcommand localizes the change. –  Werner Aug 10 '12 at 2:38
    
It works but it doesn't show anything, neither the bibliography. I'd like hiding all chapters of appendix, but showing both appendix (only one generic entry for the start of the appendix) and bibliography. –  auino Aug 17 '12 at 9:47
    
For a generic Appendix entry, insert \addtocontents{toc}{chapter}{Appendix}, followed by \let\oldaddtocontents\addtocontents \renewcommand{\addtocontents}[2]{} and then use your appendix chapters as usual. Then, before your Bibliography, add \let\addtocontents\oldaddtocontents. This assumes your document structure is such that you have a bibliography following you appendix. If this is not the case, you must have used the \renewcommand I suggested in the previous comment too soon. –  Werner Aug 17 '12 at 15:37
add comment

1 Answer

Using the tip described on TeX Stack Exchange:

\addtocontents{toc}{\setcounter{tocdepth}{-1}}
\chapter{Preface}
\addtocontents{toc}{\setcounter{tocdepth}{2}}
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.