QUESTION
I use pdflatex to generate my documents. I want to create a preview of my document and generate only the first 10 pages, but I still want the full table of contents. How do I do that?
ANSWER
\documentclass[a4paper]{article}
\usepackage[1-10]{pagesel}
\begin{document}
% text
\end{document}
Thanks to Heiko Oberdiek. Remember, though, that references and table of contents will be incomplete. An alternative way is to compile the whole document and load its first ten pages in another one via pdfpages.