How can I compile first 2 pages of 24 pages in a Latex document?

空扰寡人 提交于 2019-12-08 00:52:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!