问题
My work has over 24 pages in Latex. I need only the abstract and introduction in pdf. How can you compile only the first two pages?
回答1:
I'd just make a new file with only the abstract and introduction and compile that.
Actually, if this is not just a one-time thing, I'd use three files:
absintro.tex:
\begin{abstract}
...
\end{abstract}
...introduction...
onlyabsintro.tex:
...
\begin{document}
\include{absintro.tex}
\end{document}
fullreport.tex:
...
\begin{document}
\include{absintro.tex}
...other stuff...
\end{document}
(Obviously the filenames can be whatever you want, this just shows the structure) You can compile onlyabsintro.tex to get only the abstract and introduction, or fullreport.tex to get the whole thing.
回答2:
In addition to David's good advice, you could simple compile the whole thing, then extract the pages you want from the finished product. This might be the easiest approach for a one time task.
If you compile to PDF, consider using pdftk, which would let you use a command like:
pdftk A=one.pdf cat A1-2 output intro.pdf
来源:https://stackoverflow.com/questions/757689/how-can-i-compile-first-2-pages-of-24-pages-in-a-latex-document