We develop a technique for gluing relative trisection diagrams of 4-manifolds with nonempty connected boundary to obtain trisection diagrams for closed 4-manifolds.As an application, we describe a trisection of any closed 4-manifold which admits a Lefschetz fibration over S 2 equipped with a section of square −1, by an explicit diagram determined by the vanishing cycles of the Lefschetz fibration. In particular, we obtain a trisection diagram for some simply connected minimal complex surface of general type. As a consequence, we obtain explicit trisection diagrams for a pair of closed 4-manifolds which are homeomorphic but not diffeomorphic. Moreover, we describe a trisection for any oriented S 2 -bundle over any closed surface and in particular we draw the corresponding diagrams for T 2 × S 2 and T 2 ×S 2 using our gluing technique. Furthermore, we provide an alternate proof of a recent result of Gay and Kirby which says that every closed 4-manifold admits a trisection. The key feature of our proof is that Cerf theory takes a back seat to contact geometry.