[texhax] Fwd: Incompatibility of tcolorbox and preview packages.

Ulrike Fischer news3 at nililand.de
Wed May 14 10:59:30 CEST 2014


Am Tue, 13 May 2014 21:08:19 +0100 schrieb John C Frain:

> Thomas.Sturm has suggested that the incompatibility that I have reported
> might arise from the pgf package which is used by tcolorbox (and TikZ). If
> I modify the example like the follows, the same error is thrown:

> \usepackage{pgf}
> \usepackage{preview}
 
> The pgf/tikz was updated around end of 2013. Does the preview package use
> some internals of the previous pgf/tikz and is broken now?

No it is the other way round. 

pgf hacks preview in pgfutil-latex.def to make it compatible with
everyshi and makes there a faulty assumption:

% Preview hack: preview.sty hacks into \shipout (which is ok), but
% does not honour everyshi.sty (which is not ok). This causes 
% everyshi material to get lost.
\AtBeginDocument{
  \@ifpackageloaded{preview}{%
    % Ok, package loaded. Swap definitions of everyshi.sty's shipout
    % and preview.sty's shipout:
    \let\pgf at temp\pr at shipout% This is the original shipout
    \let\pr at shipout\@EveryShipout at Shipout% 
    \let\@EveryShipout at Org@Shipout\pgf at temp% 
  }{}%
}

This code assumes that \pr at shipout is defined if preview is loaded,
but actually \pr at shipout is only defined if preview is *active*.  
Imho the code should be changed to

\AtBeginDocument{
  \@ifpackageloaded{preview}{%
    % Ok, package loaded. Swap definitions of everyshi.sty's shipout
    % and preview.sty's shipout:
    \ifPreview
    \let\pgf at temp\pr at shipout% This is the original shipout
    \let\pr at shipout\@EveryShipout at Shipout% 
    \let\@EveryShipout at Org@Shipout\pgf at temp% 
    \fi
  }{}%
}

In your document you can get around the problem by loading preview
with the option active:
\usepackage[active]{preview}

I would suggest that you make a bug report at the pgf site. 


-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/




More information about the texhax mailing list