Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am include (with graphicx’s \includegraphics) the same small PDF vector graphics many many times in my LaTeX file, always at the same size. I then compile my document with pdflatex. While the size of the resulting PDF file is not an issue, it seems from the log file and my timing experiments that processing the PDF graphics so many times takes a lot of time, making my compilation slow. It seems something could be done, especially as the resulting object is always used at the same size.

So, what can I do to help pdflatex go faster?

share|improve this question
    
\documentclass[draft]... usually helps a lot, especially with graphicx and hyperref –  cmhughes Oct 10 '12 at 21:24
add comment

1 Answer 1

up vote 6 down vote accepted

possibly

\newbox\myimg
\savebox\myimg{\includegraphics....}

.....

\usebox\myimg 

...

\usebox\myimg
share|improve this answer
    
It works, but it saves very little time. Yet, if I put anything else in the box, it goes much faster. So, the issue may not be from reading the .pdf graphic file (as I thought), but from writing the object to the resulting PDF stream. Thanks in any case! –  F'x Oct 10 '12 at 21:04
6  
actually my (dim) recollection was that if you reused includegraphics with the same arguments the pdftex driver would recycle the pdf object rather than re-processing, The file has got more complicated since the original but I think that is still the intention pdftex.def says % mechanism for re-use of objects also % allows us to get the size by deriving it from the initial storage; % this works for all graphics types. % –  David Carlisle Oct 10 '12 at 21:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.