TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wonder wheither reusing \sbox'es decreases only .tex code or also its final output whether DVI/PDF/... i.e. does TeX expand them while writing DVI or PDF or does the viewer do that? For example gnuplot doesn't use \sbox'es for identical tickmarks on opposite sides of a plot.

share|improve this question
up vote 7 down vote accepted

No, saveboxes created with \sbox and friends do not reduce the final file size. The content is written to the output file every time it is used in the document.

I actually wrote a LaTeX package storebox which provides "storeboxes" which work like saveboxes but only store the content once in the PDF. However, this only works with pdflatex in PDF mode, not with DVI, because it uses a feature of the PDF format.

share|improve this answer
As I understand DVI file format is a kind of machine language with opcodes, and a stack, so does \sbox still reduce file size of DVI? perhaps the conversion to PDF expands them... – propaganda Jan 13 '12 at 20:25
OK, I went through the short DVI file type specification, and there's no display lists or call functions, so TeX necessarily expands repeated \sbox usage – propaganda Jan 13 '12 at 21:59

Your Answer


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.