Using an elementary fact on matrices we show by a unified approach the positivity of a partitioned positive semidefinite matrix with each square block replaced by a compound matrix, an elementary symmetric function or a generalized matrix function. In addition, we present a refined version of the Thompson determinant compression theorem.