The thermodynamics of ribbon lyotropic mesophases