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.

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

Imagine the following tikz/pgfplots code:

% compile as: lualatex --jobname=figname-f1 figname.tex
\begin{axis}[width=14cm,height=6cm,scale only axis,axis lines=left,axis]
\addplot3 coordinates{
.... % many more lines similar to the one above

This tex file is about 3Mb. Compile it to get figname-f1.pdf. Now replace by zero all the third components that are very small, ie:

\addplot3 coordinates{
.... % many more lines similar to the one above

This new tex file is about 2Mb. Compile it.

In the personal examples I am working on, the two .pdf files are of the same size, about 530kb. Is that expected?

share|improve this question
What's "1Mo"? WolframAlpha suggests 1 month, but I don't think the difference would be that big. – doncherry Oct 11 '12 at 4:49
Yes, that is to be expected, since these are just coordinates, and there is virtually no difference in the placement of the markers in those locations. The difference in the .tex file stems from the loss in characters. – Werner Oct 11 '12 at 4:49
What is 1Mo? Keep in mind that file sizes on computers are not continuous, they are usually in 4k chunks to optimize disk performance. So, if you are seeing size differences in the .tex (whcih are just plain text files) with such small changes then it is probably because you crossed this quantized amount. – Peter Grill Oct 11 '12 at 4:50
@Werner: ha yes I see, it is because points are then projected on the plane. Too bad. – pluton Oct 11 '12 at 4:56
@doncherry The French prefer to call them "mégaoctets" rather than "mebibytes" (or "megabytes") and I find this perfectly legitimate. It's futile, though, using a symbol which is not understood outside of France (this is not a rebuke to pluton, of course). By the way, the IEC proposed the symbol MiB, which is endorsed by IEEE and CIPM (source Wikipedia) – egreg Oct 11 '12 at 9:32
up vote 4 down vote accepted

It is important to note that (La)TeX interprets the code and generates output. Output in this instance is the resulting PDF which, in its binary form, consists of a bunch of shapes (circles, lines, rectangles and some embedded content like fonts, perhaps).

It may be that the interpretation of (2,3) results in a generalized representation of (2.0000000,3.0000000) in PDF binary form, thereby inflating the size of the resulting PDF to accommodate for accuracy up to 7 decimals*. However, this also means that specifying accuracy beyond 7 decimals may be rounded/truncated (or deflated). This standardization on the output side of things results in similar-sized PDFs even though the input may very dramatically in terms of its precision under the condition that you keep the number & type of objects/shapes the same.

Whether you place an object/shape in your code (input) at position (2,3), position (2.0,3.0), position (2.0001,3.0001) or at position (2.718281828459045,3.141592653589793), the result (output) will still be the same object/shape in two dimensions in the PDF. So, the same size output is expected.

* I'm not sure about the accuracy used in PDF binaries. This was just an example.

share|improve this answer

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.