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 have the following piece of code:

% command: pdflatex --jobname=try-f1 try.tex
\documentclass[12pt]{book}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=newest}
\pgfrealjobname{try}
\begin{document}
\beginpgfgraphicnamed{try-f1}%
\begin{tikzpicture}
\pgfplotsset{minor grid style={color=black!20,line width=0.25pt},major grid style={color=black!30,line width=0.35pt}}
\begin{semilogyaxis}[grid=both,enlargelimits=false,scale only axis,width=6.5cm,height=4.5cm,tick style={draw=none},xticklabels={},yticklabels={},axis background/.style={fill=black!3}]
\addplot[solid] coordinates{600 points coded as (0.028,6.28386e-005) for instance}
\end{semilogyaxis}
\end{tikzpicture}
\endpgfgraphicnamed
\end{document}

the size of tex source as a text file is 12ko and 4 ko when zipped while the final pdf is 8ko. Is all this expected? I thought the final pdf would be lighter than the zipped file.

share|improve this question
    
Why would you assume the final pdf to be smaller? It includes a lot more information than the zipped source code, so if anything I'm surprised it's not much larger. –  Jake Aug 3 '11 at 0:44
    
I thought pdf was somehow more efficient than zip because of destructive compression. –  pluton Aug 3 '11 at 0:55
    
No. For example, the PDF includes embedded fonts that is not included in the flat format TEX file. –  Werner Aug 3 '11 at 1:25
    
correct but in the provided example, fonts have been removed on purpose. –  pluton Aug 3 '11 at 5:03
    
There are macros to control the compression level of pdf. I do not have the reference at hand, but I believe the macro (for pdflatex) is \pdfcompresslevel=<integer>. Even further compression can be archived if \pdfminorversion=5 (or something like this) because a particular pdf version introduced not just stream data compression but also compression of pdf object definitions. The pgfplots manual (doc/latex/pgfplots/pgfplots.tex ) has these macros somewhere. \pdfcompresslevel=0 should result in a completely uncompressed pdf. –  Christian Feuersänger Aug 3 '11 at 7:44
show 4 more comments

1 Answer

up vote 4 down vote accepted

There are macros to control the compression level of pdf. I do not have the reference at hand, but I believe the macro (for pdflatex) is \pdfcompresslevel=<integer>. Even further compression can be archived if \pdfminorversion=5 (or something like this) because a particular pdf version introduced not just stream data compression but also compression of pdf object definitions. The pgfplots manual (doc/latex/pgfplots/pgfplots.tex ) has these macros somewhere. \pdfcompresslevel=0 should result in a completely uncompressed pdf.

By the way: pdf uses zip internally to compress its data - especially data streams. Lossy compression is only applied if you (explicitly) include jpg images (or requantization of pngs).

share|improve this answer
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.