Born-Green-Yvon approach to the local densities of a fluid at interfaces