Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

Precompileing parts of a document other than the header

瀏覽次數:99 次
跳到第一則未讀訊息

Cameron Bracken

未讀,
2008年10月28日 清晨5:55:592008/10/28
收件者:
I recently found out that I could precompile my latex header to save
some time in compiling. I use alot of PGF/TikZ graphics which can
take a long time to compile though I am not necessarily changing them
every time I compile. This leads me to my question, Is it possible to
precompile an arbitrary chunk of a document and use something like an
\input{} to include that precompiled piece? This could be a huge time
saver.

My initial attempts at this were unsuccessful though I was just
hacking around. Any suggestions?

Thanks,

Cameron Bracken
Humboldt State University

Martin Heller

未讀,
2008年10月28日 上午10:31:362008/10/28
收件者:
Cameron Bracken skrev:

> I recently found out that I could precompile my latex header to save
> some time in compiling. I use alot of PGF/TikZ graphics which can
> take a long time to compile though I am not necessarily changing them
> every time I compile. This leads me to my question, Is it possible to
> precompile an arbitrary chunk of a document and use something like an
> \input{} to include that precompiled piece? This could be a huge time
> saver.

\includeonly can be used to specify which parts of the document
you want to complile. See also packages askinclude and stampinclude.

<http://www.ctan.org/pkg/askinclude>
<http://www.ctan.org/pkg/stampinclude>

> My initial attempts at this were unsuccessful though I was just
> hacking around. Any suggestions?

You could give LaTeXdaemon a try.

<http://code.google.com/p/latexdaemon/>

Robin Fairbairns

未讀,
2008年10月28日 下午1:16:412008/10/28
收件者:
Cameron Bracken <cameron...@gmail.com> writes:
>I recently found out that I could precompile my latex header to save
>some time in compiling. I use alot of PGF/TikZ graphics which can
>take a long time to compile though I am not necessarily changing them
>every time I compile. This leads me to my question, Is it possible to
>precompile an arbitrary chunk of a document and use something like an
>\input{} to include that precompiled piece? This could be a huge time
>saver.

in principal you can; the technique wasn't designed with ease of use
in mind...

look at http://mirror.ctan.org/macros/latex/contrib/carlisle/mylatex.ltx

with that you can in principle create a format mylatex.ftm which you
load with
latex -fmt=mylatex <file>

i can't imagine it would be workable with a tex shell of any sort.
i've never done it myself, but the author's reliable and i've heard of
others managing the trick.
--
Robin Fairbairns, Cambridge

Bernd Strieder

未讀,
2008年10月28日 下午1:30:342008/10/28
收件者:
Hello,

Cameron Bracken wrote:

> I recently found out that I could precompile my latex header to save
> some time in compiling. I use alot of PGF/TikZ graphics which can
> take a long time to compile though I am not necessarily changing them
> every time I compile. This leads me to my question, Is it possible to
> precompile an arbitrary chunk of a document and use something like an
> \input{} to include that precompiled piece? This could be a huge time
> saver.

Maybe you can put the time-consuming parts into documents of their own,
produce the pdfs and include those with includegraphics. So you have to
TeX the graphics only when changed, not in every run of your main
document. It should be possible to put common parts of the headers into
files to be used by the main file and the parts. One problem I don't
know a solution for in the moment might be to get the bounding boxes of
those graphics tight to make inclusion easy. I'm not sure whether this
solution might cause fonts to be included multiple times.

AFAIK the latest edition of the book "The LaTeX Companion" has been done
with that technique for the code examples and their results shown in
the book. So it has been done, and there might be a description in that
book.

Bernd Strieder

Cameron Bracken

未讀,
2008年10月28日 晚上7:45:152008/10/28
收件者:
Thanks for the replies. It sounds like there may be some hope. I just
wanted to add for anyone who precompiles their headers, I wrote a
shell script called pretex to make it a little easier. It is
available under the GPL.

http://cameron.googlecode.com/svn/trunk/misc/bash/pretex

Kjell Magne Fauske

未讀,
2008年10月29日 清晨6:27:102008/10/29
收件者:
On Oct 29, 12:45 am, Cameron Bracken <cameron.brac...@gmail.com>
wrote:

You mentioned that you use a lot of TikZ graphics. In the CVS version
of TikZ/PGF there is a new externalization library that makes it easy
to store your tikzpictures as external files so that you can avoid
recompiling the graphics every time. If compilation time is an issue
you should check it out.

You can get a CVS version of PGF from the sourceforge project page, or
download a recent build from:
http://www.texample.net/tikz/builds/


You may find some more information in this recent discussion thread on
the PGF-users mailing list:
http://www.nabble.com/Precompiled-preamble-w--tikz.-td20110172.html

Regards,
Kjell Magne Fauske

Cameron Bracken

未讀,
2008年10月29日 下午6:08:582008/10/29
收件者:

This is EXACTLY what I was looking for! I am trying it now, Thanks
alot!

-Cameron Bracken

0 則新訊息