10

The following MWE simulates the problem. Compile it with pdflatex -shell-escape.

\documentclass[preview,varwidth,border=12pt]{standalone}
\usepackage{filecontents}

\begin{filecontents*}{common.tex}
\documentclass[tikz]{standalone}
\begin{document}
\foreach \y in {0,10,...,110}{
\begin{tikzpicture}
    \shade[top color=yellow] (-2.2,-2.2) rectangle (2.2,2.2);
    \shade[ball color=black] (0,0) circle (.25);
    \foreach \x in {\y,\y+120,\y+240}{\shadedraw[inner color=blue,outer color=magenta] (\x:2) arc (\x:\x+60:2) -- (\x+60:.3) arc (\x+60:\x:.3) -- cycle;}
\end{tikzpicture}}
\end{document}
\end{filecontents*}


\begin{document}
\immediate\write18{latex -jobname=common-latex common}
\immediate\write18{dvips common-latex}
\immediate\write18{ps2pdf common-latex.ps}
\immediate\write18{pdflatex -jobname=common-pdflatex common}

common-latex size: \pdffilesize{common-latex.pdf}

common-pdflatex size: \pdffilesize{common-pdflatex.pdf}
\end{document}

enter image description here

Why does compiling TikZ with latex-dvips-ps2pdf produce a much much bigger PDF than with pdflatex? For the given example above, the factor is about 690027 / 9263 = 74 that is extremely fantastic.

  • 3
    I don't have an answer but I admire the problem! – Benedikt Bauer Jul 02 '13 at 12:35
  • My guess would be the difference in vector graphic storage solutions between PS and PDF --- I'm hardly versed on the topic though, and look forward to an answer! – Sean Allred Jul 02 '13 at 13:01
  • 2
    It's the shadings. Everytime a shading is used a new item is created from scratch which inflates the size. There must be a duplicate for this. – percusse Jul 02 '13 at 13:24

0 Answers0