Page Layout ⇒ Hiding chapters in output
Hiding chapters in output
I don't know if this is possible, but I'd like to know how to keep chapters from appearing in the output and in the table of contents, while keeping their labels intact (so I can still use \ref{a_label_in_a_hidden_chapter}).
To clarify, here's the background: I have written a large text in LaTeX and it has already been printed. Now, I want to write an addendum (probably using \appendix) to that text, which will be printed separately. I don't want any of the original chapters to be in the output or the table of contents, but I still want to be able to print the section numbers of the original text by using \ref.
Is this possible? How? And what about figures; I'd like to be able to refer to them in the same way, if possible? And how about BibTeX entries?
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Hiding chapters in output
you can play with the counter tocddepth:
Code: Select all
\documentclass[11pt, a4paper,english]{scrreprt}
\usepackage{babel}
\usepackage{blindtext}
\let\origchap=\chapter
\def\mychapter#1{%
\addtocontents{toc}{\protect\setcounter{tocdepth}{-5}\endgraf}%
\chapter{#1}%
\addtocontents{toc}{\protect\setcounter{tocdepth}{3}\endgraf}%
\addtocontents{toc}{\vskip1em\null}
}
\begin{document}
\tableofcontents
\chapter{foo}
\blindtext[2]
\section{foo bar}
\blindtext
\mychapter{foo}
\blindtext[2]
\section{foo bar}
\blindtext
\end{document}
Marco
