Layer rigidity and spacing in intercalation compounds.