  We give an abstract criterion for pasting pseudofunctors on two subcategories
of a category into a pseudofunctor on the whole category. As an application we
extend the variance theory of the twisted inverse image $(-)^!$ over schemes to
that over formal schemes. Thus we show that over composites of compactifiable
maps of noetherian formal schemes, there is a pseudofunctor $(-)^!$ such that
if $f$ is a pseudoproper map, then $f^!$ is the right adjoint to the derived
direct image $\R f_*$ and if $f$ is etale, then $f^!$ is the inverse image
$f^*$. We also show that $(-)^!$ is compatible with flat base change.
