Perpendicular and lateral equations of state in layered systems of amphiphiles