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?
Asked
Active
Viewed 2,385 times
16
doncherry
- 54,637
1 Answers
21
\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.
Alex Hirzel
- 522
egreg
- 1,121,712
-
1@Peteris: The solution given above does not use pdfpages. @egreg just added another method by using pdfpages. :-) – Display Name Jun 05 '11 at 15:38
-
1
-
-
2@Peteris, @egreg -- if a complete run has previously created a full table of contents, it should suffice for the partial run to insert the command
\nofilesin the preamble. then the old toc (and aux files) won't be overwritten. of course, this doesn't work if it's necessary to have intermediate working files for the first ten pages. – barbara beeton Jun 06 '11 at 12:39
\includeonlywhich is invoked in the preamble to activate only one inclusion but the whole indexing and cross referencing still work? – Display Name Jun 05 '11 at 15:10\everypar{\ifnum\thepage>10 \stop\fi}will load faster!? – yannisl Jun 05 '11 at 17:51