I have written a paper that includes a couple of TikZ pictures and submitted it to a (Springer) journal. I was quite shocked when I got the pdf file they produced from my source file, since it was over 8 MiB - while my own pdf is only 170 KiB.
First, I cut the pdf to single pages and found that the size comes from the TikZ pictures.
Then I realized that the journal most likely uses tex -> dvi -> ps -> pdf workflow, while I am using pdflatex. I therefore compiled the paper the other way and there it was: dvi file was 655 KiB, ps (via dvips) was 625 KiB, but pdf (via ps2pdf, or via ghostview) was 7.8 MiB. (The small difference is due to the journal adding a title page.)
Is there some way to produce a more reasonably-sized pdf file using the dvips-based route?
I tried adding \newcommand{\pgfsysdriver}{pgfsys-dvips.def} just before including tikz, but it did not do anything.
I also tried producing eps version of the figures, using the 'external' package to create poscript figures, but it is the same: for one of the figures, it is 12 KiB saved as pdf and 183 KiB as ps - which gives 183 KiB eps and then 3.1 MiB(!) pdf using epstopdf. (If I convert the 12 KiB pdf to eps in ghostview, I get 1.5 MiB eps, which then gives 361 KiB pdf using epstopdf - bit better, but still huge.)
edit: a working example:
\documentclass{article}
\usepackage{tikz}
\tikzstyle{strat}=[text=white, circle, ball color=red, inner sep=3pt]
\tikzstyle{oper}=[text=white, rectangle, ball color=blue, inner sep=1.75pt, level distance=\lvlDist]
\newlength\lvlDist\setlength\lvlDist{12pt} % distance between levels
\begin{document}
\begin{figure}[tbp]
\centering
\begin{tikzpicture}[level distance=\lvlDist, grow=down, every node/.style={oper}]
\path[
level 1/.style={sibling distance=40mm},
level 6/.style={sibling distance=20mm},
level 7/.style={sibling distance=10mm},
level 12/.style={sibling distance=5mm},
level 13/.style={sibling distance=2mm}
]
node[strat](root){} child foreach \oPI in {1,...,2} {
node{} child { node{} child { node{} child {node{} child {
node{} child foreach \perI in {1,...,2} {
node[strat]{} child foreach \oPII in {1,...,2} {
node{} child { node{} child { node{} child { node{} child {
node{} child foreach \perII in {1,...,2} {
node[strat]{} child foreach \oPIII in {1,...,2} {
node{} child { node{} child { node{} child { node{} child {
node{}
}}}}}
}}}}}}
}}}}}
}
;
\end{tikzpicture}
\end{figure}
\end{document}
Pdflatex produces a 19 KiB pdf, while latex + dvips + ps2pdf give 209 KiB dvi -> 197 KiB ps -> 2954 KiB pdf.
Thanks
foreachloops. I can try to create MWE later (no time just now) - I just thought it might be a known problem.. – Michal Kaut Jul 31 '12 at 11:29\pdfcompresslevel=0also apply for the dvips route?) – Christian Feuersänger Jul 31 '12 at 18:06