Package ctable loads package transparent. Both package transparent and tikz implements transparency. This needs access to a page resource, a dictionary ExtGState for the transparent values. Unhappily, the LaTeX format has overslept the PDF development quite entirely. Managing global resources is the prime task for an OS, format in TeX speek. Because of the missing resource manager, both packages do what most packages do, they think they are alone and add their stuff to the resource, \pdfpageresources in this case. The result for
% PDF file without compression for easier reading/analyzing
\pdfobjcompresslevel=0
\pdfcompresslevel=0
\documentclass{standalone}
\usepackage{tikz}
\usepackage{transparent}
\begin{document}
\begin{tikzpicture}
\filldraw[opacity=.5] (0,0) rectangle (1,1);
\end{tikzpicture}
\end{document}
PDF object 4 contains the Resources for the page (reformatted):
4 0 obj
<<
/ColorSpace 3 0 R
/Pattern 2 0 R
/ExtGState 1 0 R % by TikZ, see next object
/ExtGState << % by package transparent
/TRP1 << /ca 1 /CA 1 >>
>>
/ProcSet [ /PDF ]
>>
endobj
1 0 obj
<<
/pgf@CA.5 << /CA .5 >>
/pgf@ca.5 << /ca .5 >>
>>
endobj
As can be seen, the dictionary Resources (object 4) contains two entries ExtGState, which is not allowed by the PDF specification. Now it's up to the PDF reader, how it resolves the issue and which entry is used. Thus its by accident, if the PDF works for which program/printer. If the transparency of both packages are used in the page, then there will be always an error, because one of the ExtGState is missing at any case. Otherwise there is a 50:50 chance, that the PDF viewer/printer picks the unused ExtGState and throws away the other.
If you do not need the transparency of ctable/transparent, then you can fool LaTeX in thinking, that transparent is already loaded:
\makeatletter
\@namedef{ver@transparent.sty}{}
\makeatother
\usepackage{ctable}
Package ctable could provide an option for turning transparency off.
Patch for transparent to use package pgf's resource management
The following patch is applied after package transparent is loaded.
Then it cooperates with package pgf by using the macro \pgfutil@addresource@extgs for the transparent settings and the transparency methods of both packages can be used.
\documentclass{standalone}
\usepackage{tikz}
\usepackage{transparent}
\makeatletter
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pgfutil@addpdfresource@extgs\endcsname\relax
\else
\AtBeginDocument{%
% \pgf@sys@addpdfresource@extgs@plain{%
\pgfutil@addpdfresource@extgs{%
\TRP@list
}%
}%
\let\TRP@addresource\relax
\fi
\makeatother
\begin{document}
Hello \texttransparent{.3}{World}
\begin{tikzpicture}
\filldraw[opacity=.5] (0,0) rectangle (1,1);
\end{tikzpicture}
\makeatletter
\end{document}
Also the disabling of \transparent by package ctable can be undone. The warning remains, but can be ignored.
\documentclass{standalone}
\usepackage{tikz}
\usepackage{transparent}
\let\OriginalTransparent=\transparent
\makeatletter
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname pgfutil@addpdfresource@extgs\endcsname\relax
\else
\AtBeginDocument{%
% \pgf@sys@addpdfresource@extgs@plain{%
\pgfutil@addpdfresource@extgs{%
\TRP@list
}%
}%
\let\TRP@addresource\relax
\fi
\makeatother
\usepackage{ctable}
\AtBeginDocument{%
\let\transparent=\OriginalTransparent
}
\begin{document}
Hello \texttransparent{.3}{World}
\begin{tikzpicture}
\filldraw[opacity=.5] (0,0) rectangle (1,1);
\end{tikzpicture}
\makeatletter
\end{document}
ctable? – percusse Jul 02 '15 at 20:16spy-library is then probably a totally unrelated issue. I don't need to but it would be nice to avoid changing all the tables in the report (I noticed this error quite late in the project, haven't printed the report for proofreading earlier). – Jul 02 '15 at 20:33