General crystal structure of TMHPs (taking (MBA)PbI4 as the model), where a, d, and h refer to the penetration depth of the cations, the distance between two adjacent inorganic layers, and the distance between two adjacent planes for the Pb centers in the [PbI6]4− octahedra, respectively. The hydrogen bonds between the –NH3+ groups and the terminal/bridging I atoms are highlighted with orange/blue dashed lines, respectively.