How can I compile first 2 pages of 24 pages in a L

2019-05-22 16:19发布

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?

2条回答
Evening l夕情丶
2楼-- · 2019-05-22 16:58

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.

查看更多
ら.Afraid
3楼-- · 2019-05-22 17:08

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
查看更多
登录 后发表回答